forked from GGC-SD/bash_basics
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path12-monkeys.sh
More file actions
20 lines (18 loc) · 778 Bytes
/
12-monkeys.sh
File metadata and controls
20 lines (18 loc) · 778 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# exercise: implement another counting song (such as 12 days of Christmas)
# using loops and if statements.
echo "Now, let's sing monkey jumping on the bed."
echo "How many monkeys are jumping on the bed?"
read number
while [ $number -ge 0 ]; do
if [ $number -ge 2 ]; then
echo "$number little monkeys jumping on the bed. One fell off and bumped its head."
echo "Momma called the doctor and the doctor said, 'No more Monkeys jumping on the bed!'"
elif [ $number -ge 1 ]; then
echo "$number little monkeys jumping on the bed. One fell off and bumped its head."
echo "Momma called the doctor and the doctor said, 'No more Monkeys jumping on the bed!'"
else
echo "No more monkeys jumping on the bed."
fi
((number = number - 1))
done
#statements