diff --git a/07-beer.sh b/07-beer.sh index c03aded..5b8b18c 100644 --- a/07-beer.sh +++ b/07-beer.sh @@ -22,3 +22,38 @@ done # exercise: implement another counting song (such as 12 days of Christmas) # using loops and if statements. + +echo "Let's sing a Christmass song!" + +days=1 +while [ $days -le 12 ]; do + if [ $days -eq 1 ]; then + echo "On the first day of Christmas, my true love sent to me... A partridge in a pear tree" + elif [ $days -eq 2 ]; then + echo "On the second day of Christmas, my true love sent to me... Two turtle doves and A partridge in a pear tree" + elif [ $days -eq 3 ]; then + echo "On the third day of Christmas, my true love sent to me... Three french hens Two turtle doves and A partridge in a pear tree" + elif [ $days -eq 4 ]; then + echo "On the fourth day of Christmas, my true love sent to me: four calling birds, three French hens, two turtle doves, and a partridge in a pear tree" + elif [ $days -eq 5 ]; then + echo "On the fifth day of Christmas, my true love sent to me: five golden rings, four calling birds, three French hens, two turtle doves, and a partridge in a pear tree." + elif [ $days -eq 6 ]; then + echo "On the sixth day of Christmas, my true love sent to me: six geese a-laying, five golden rings, four calling birds, three French hens, two turtle doves, and a partridge in a pear tree." + elif [ $days -eq 7 ]; then + echo "On the seventh day of Christmas, my true love sent to me: seven swans a-swimming, six geese a-laying, five golden rings, four calling birds, three French hens, two turtle doves, and a partridge in a pear tree." + elif [ $days -eq 8 ]; then + echo "On the eighth day of Christmas, my true love sent to me: eight maids a-milking, seven swans a-swimming, six geese a-laying, five golden rings, four calling birds, three French hens, two turtle doves, and a partridge in a pear tree." + elif [ $days -eq 9 ]; then + echo "On the ninth day of Christmas, my true love sent to me: nine ladies dancing, eight maids a-milking, seven swans a-swimming, six geese a-laying, five golden rings, four calling birds, three French hens, two turtle doves, and a partridge in a pear tree." + elif [ $days -eq 10 ]; then + echo "On the tenth day of Christmas, my true love sent to me: ten lords a-leaping, nine ladies dancing, eight maids a-milking, seven swans a-swimming, six geese a-laying, five golden rings, four calling birds, three French hens, two turtle doves, and a partridge in a pear tree." + elif [ $days -eq 11 ]; then + echo "On the eleventh day of Christmas, my true love sent to me: eleven pipers piping, ten lords a-leaping, nine ladies dancing, eight ma" + else + echo "On the twelfth day of Christmas, my true love sent to me: twelve drummers drumming, eleven pipers piping, ten lords a-leaping, nine ladies dancing, eight maids a-milking, seven swans a-swimming, six geese a-laying, five gold rings, four calling birds, three French hens, two turtle doves, and a partridge in a pear tree." + fi + + # the following statement is equivalent to: let "count=count-1" + ((days = days + 1)) + +done diff --git a/2Branches Caleb Butler.PNG b/2Branches Caleb Butler.PNG new file mode 100644 index 0000000..796a8a6 Binary files /dev/null and b/2Branches Caleb Butler.PNG differ diff --git a/Merged Caleb Butler.PNG b/Merged Caleb Butler.PNG new file mode 100644 index 0000000..8781ac5 Binary files /dev/null and b/Merged Caleb Butler.PNG differ