0

So, I had a quick question about having multiple arguments being read into a bash script. In the following script, if I type "./myscript -h", it returns "Hippo.". However, if I type "./myscript -h -k", the script returns only "Hippo." I would like to know how to have the script print out both "Hippo." and "Kangaroo.". What is the easiest way to do this?

case "$*" in
*-h*)
echo "Hippo."
;;
*-k*)
echo "Kangaroo."
esac

Thanks in advance.

2
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by SoulMazer
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.