[Linux] Bash command help...
Bert Garcia
hgarcia@imigo.com
Mon, 23 Oct 2000 10:33:01 -0400
Jack Sasportas wrote:
>
> Can someone direct me to a url that has case & elif command
> documentation with example code ?
>
> Not doing too well with the man pages, and other searches from the
> web...
>
> Thanks !
>From the Beginning Linux Programming, 2nd Edition, Wrox - good book to
have around when the brain gets full.
if ["$timeofday" = "yes" ]
then
echo "Good morning"
elif ["$timeofday" = "no" ]; then
echo "Good afternoon"
else
echo "Sorry, $timeofday not recognized. Enter yes or no"
exit 1
fi
case "$timeofday" in
yes | y | Yes | YES ) echo "Good Morning";;
n* | N* ) echo "Good Afternoon";;
* ) echo "Sorry, answer not recognized";;
esac
--
bert garcia