6DrjcQZb / No title
Revision d4a3a3a8f12d (7 months, 4 weeks ago) - Diff
Link to this snippet : http://friendpaste.com/6DrjcQZb
| 1 | #!/bin/bash |
|---|---|
| 2 | # Listing the planets and the Pluto thing |
| 3 | |
| 4 | for planet in Mercury Venus Earth Mars Jupiter Saturn Uranus Neptune Pluto |
| 5 | do |
| 6 | echo $planet # Each planet on a separate line. |
| 7 | done |
| 8 | |
| 9 | echo |
| 10 | |
| 11 | for planet in "Mercury Venus Earth Mars Jupiter Saturn Uranus Neptune Pluto" |
| 12 | # All planets on same line. |
| 13 | # Entire 'list' enclosed in quotes creates a single variable. |
| 14 | # Why? Whitespace incorporated into the variable. |
| 15 | do |
| 16 | echo $planet |
| 17 | done |
| 18 | |
| 19 | exit 0 |
View in other formats:
raw format | download source