linux-tutorial/codes/demos/bash/statement/caseDemo.sh

19 lines
271 B
Bash
Raw Normal View History

2017-11-17 17:06:52 +08:00
#!/usr/bin/env bash
echo "input param: " $1
case $1 in
"jpg" | "jpeg")
echo "It's image with jpeg extension."
;;
"png")
echo "It's image with png extension."
;;
"gif")
echo "Oh, it's a giphy!"
;;
*)
echo "Woops! It's not image!"
;;
esac