Imported from ../bash-2.02.tar.gz.

This commit is contained in:
Jari Aalto
1998-04-17 19:52:44 +00:00
parent e8ce775db8
commit cce855bc5b
323 changed files with 33916 additions and 12321 deletions

View File

@@ -0,0 +1,18 @@
# The following prints a random card from a card deck.
#
# cribbed from the ksh93 book, example from page 70
#
# chet@po.cwru.edu
#
declare -i i=0
# load the deck
for suit in clubs diamonds hearts spades; do
for n in ace 2 3 4 5 6 7 8 9 10 jack queen king; do
card[i]="$n of $suit"
i=i+1 # let is not required with integer variables
done
done
# and print a random card
echo ${card[RANDOM%52]}