| 1 | #!/bin/bashscip-shell filesystem . . `/bin/bash`. |
| 2 | |
| 3 | var1=unset |
| 4 | previous=$var1 |
| 5 | |
| 6 | while echoscip-shell system . . echo. "previous-variable = $previous" |
| 7 | echoscip-shell system . . echo. |
| 8 | previous=$var1 |
| 9 | [scip-shell system . . `[`. "$var1" != end ] # Keeps track of what $var1 was previously. |
| 10 | # Four conditions on *while*, but only the final one controls loop. |
| 11 | # The *last* exit status is the one that counts. |
| 12 | do |
| 13 | echoscip-shell system . . echo. "Input variable #1 (end to exit) " |
| 14 | read var1 |
| 15 | echoscip-shell system . . echo. "variable #1 = $var1" |
| 16 | done |
| 17 | |
| 18 | # Try to figure out how this all works. |
| 19 | # It's a wee bit tricky. |
| 20 | |
| 21 | exit 0 |