17 lines
488 B
Bash
Executable File
17 lines
488 B
Bash
Executable File
#!/bin/bash
|
|
|
|
#
|
|
# Demonstration of the 'case' command
|
|
#
|
|
for fruit in banana apple pear kiwi nectarine; do
|
|
case $fruit in
|
|
banana) echo "$fruit: don't eat the skin" ;;
|
|
apple) echo "$fruit: eat the skin or not, as you please" ;;
|
|
kiwi) echo "$fruit: most people remove the skin" ;;
|
|
nectarine) echo "$fruit: leave the skin on and eat it" ;;
|
|
*) echo "$fruit: not sure how to advise" ;;
|
|
esac
|
|
done
|
|
|
|
exit
|