| 1 | #!/bin/bashscip-shell filesystem . . `/bin/bash`. |
| 2 | |
| 3 | a=23 # Simple case |
| 4 | echoscip-shell system . . echo. $a |
| 5 | b=$a |
| 6 | echoscip-shell system . . echo. $b |
| 7 | |
| 8 | # Now, getting a little bit fancier (command substitution). |
| 9 | |
| 10 | a=`echoscip-shell system . . echo. Hello!` # Assigns result of 'echo' command to 'a' ... |
| 11 | echoscip-shell system . . echo. $a |
| 12 | # Note that including an exclamation mark (!) within a |
| 13 | #+ command substitution construct will not work from the command-line, |
| 14 | #+ since this triggers the Bash "history mechanism." |
| 15 | # Inside a script, however, the history functions are disabled by default. |
| 16 | |
| 17 | a=`lsscip-shell system . . ls. -l` # Assigns result of 'ls -l' command to 'a' |
| 18 | echoscip-shell system . . echo. $a # Unquoted, however, it removes tabs and newlines. |
| 19 | echoscip-shell system . . echo. |
| 20 | echoscip-shell system . . echo. "$a" # The quoted variable preserves whitespace. |
| 21 | # (See the chapter on "Quoting.") |
| 22 | |
| 23 | exit 0 |