Debian Codegraph @

ex22.sh

raw symbols SCIP
1 #!/bin/bash
2 # Listing the planets.
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; 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 echo; echo "Whoops! Pluto is no longer a planet!"
20
21 exit 0