| 1 | #!/bin/bash |
| 2 | |
| 3 | echo |
| 4 | # Equivalent to: |
| 5 | while [ "$var1" != "end" ] # while test "$var1" != "end" |
| 6 | do |
| 7 | echo "Input variable #1 (end to exit) " |
| 8 | read var1 # Not 'read $var1' (why?). |
| 9 | echo "variable #1 = $var1" # Need quotes because of "#" . . . |
| 10 | # If input is 'end', echoes it here. |
| 11 | # Does not test for termination condition until top of loop. |
| 12 | echo |
| 13 | done |
| 14 | |
| 15 | exit 0 |