Switch Case Statement in Bash

Switch Case Statement in Bash

[bash]
case "$VAR" in
"foo")
echo "This is foo"
;;
"bar")
echo "It’s bar"
;;
*)
echo "Default case"
;;
esac
[/bash]

Leave a Reply

Your email address will not be published. Required fields are marked *