6DrjcQZb / No title

Revision d4a3a3a8f12d (7 months, 4 weeks ago) - Diff

Link to this snippet : http://friendpaste.com/6DrjcQZb

  • Wrap long lines
  • Show line numbers
1#!/bin/bash
2# Listing the planets and the Pluto thing
3
4for planet in Mercury Venus Earth Mars Jupiter Saturn Uranus Neptune Pluto
5do
6 echo $planet # Each planet on a separate line.
7done
8
9echo
10
11for 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.
15do
16 echo $planet
17done
18
19exit 0

View in other formats:
raw format | download source

  1.   

6DrjcQZb / No title

last change Thu Mar 27 08:58:52 2008 (UTC)

Older revisions