Bash Case Matching Linux Example
Page 1 of 1
Bash Case Matching Linux Example
- Code:
#!/bin/bash
echo -n "Enter the name of an animal: "
read ANIMAL
echo -n "The $ANIMAL has "
case $ANIMAL in
horse | dog | cat) echo -n "four";;
penguine | bird | kangaroo ) echo -n "two";;
spider | fly ) echo -n "eight";;
snake | whale ) echo -n "none";;
*) echo -n "an unknown number of";;
esac
echo " legs."
Similar topics
» Bash Psychic Game For Linux Bash
» Linux BASH Script Running Commands and Functions From Bash Script and saving to varables
» Loading Bar For Bash In Linux
» Calculating Pi With Bash On Linux
» Linux Bash Who Am I Game Example
» Linux BASH Script Running Commands and Functions From Bash Script and saving to varables
» Loading Bar For Bash In Linux
» Calculating Pi With Bash On Linux
» Linux Bash Who Am I Game Example
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|