animal.bash 395 B

1234567891011121314
  1. #!/bin/bash
  2. echo -n "Enter the name of an animal: "
  3. read ANIMAL
  4. echo -n "The $ANIMAL has "
  5. case $ANIMAL in
  6. horse | dog | cat) echo -n "four";;
  7. man | kangaroo ) echo -n "two";;
  8. # the *) is a pattern that ANIMAL will match
  9. # this is just a smooth way of doing something be default, if the above patters
  10. # do not match
  11. *) echo -n "an unknown number of";;
  12. esac
  13. echo " legs."