-
Notifications
You must be signed in to change notification settings - Fork 342
/
11-song.sh
44 lines (38 loc) · 807 Bytes
/
11-song.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/sh
while [ true ]; do
# you can show a prompt with the read command
read -p "Do rae mi fa so la ti do? (q to end) > " note
case $note in
# each case matches a pattern
do|Do)
echo "Doe a deer a female deer"
;;
rae|Rae)
echo "Ray a drop of golden sun"
;;
mi|Mi)
echo "Me a name a call myself"
;;
fa|Fa)
echo "Far a long long way to run"
;;
so|So)
echo "So a note that follows fa"
;;
la|La)
echo "La a note that follow so"
;;
ti|ta)
echo "Tea I drink with jam and bread"
;;
q)
echo "Hope you enjoyed the sound of music"
exit 0
;;
*)
echo "Not a note"
;;
esac
done
# exercise: Change the input question and case
# statement to another theme.