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.

Alright it solved my problem. Thank you very much.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.