Skip to content
Open
Show file tree
Hide file tree
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
24 changes: 24 additions & 0 deletions 07-beer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,30 @@ while [ $count -ge 0 ]; do
((count = count - 1))

done
echo ""

echo "Now let's sing 5 little ducks"

ducks=5

while [ $ducks -ge 0 ]; do
if [ $ducks -gt 1 ]; then
echo "$ducks little ducks went out one day"
echo "Over the hills and far away"
echo "Mother duck said quack quack quack quack"
elif [ $ducks -eq 1 ]; then
echo "$ducks little duck went out one day"
echo "Over the hills and far away"
echo "Mother duck said quack quack quack quack"
else
echo "No little ducks went out one day"
echo "Over the hills and far away"
echo "Mother duck said quack quack quack quack"
echo "And all of the 5 little ducks came back"
fi

echo ""
ducks=$((ducks - 1))
done
# exercise: implement another counting song (such as 12 days of Christmas)
# using loops and if statements.
Binary file added aftermerge.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added twobranch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.