Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions 07-beer.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,26 @@ done

# exercise: implement another counting song (such as 12 days of Christmas)
# using loops and if statements.

echo ""
echo "Let's sing a 7 days Christmas song"

for day in 1 2 3 4 5 6 7; do
echo "on the $day day of Christmas, my true love gave to me:"

if [ $day -eq 1 ]; then
echo "a partridge in a pear tree"

elif [ $day -eq 2 ]; then
echo "Two turtle doves"
echo "And a partridge in a pear tree"

elif [ $day -eq 3 ]; then
echo "Three French hens"
echo "Two turtle doves"
echo "And a partridge in a pear tree"

else
echo "$day wonderful gifts!"
fi
done