Created
January 12, 2013 08:10
-
-
Save anonymous/4516697 to your computer and use it in GitHub Desktop.
case.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
read -p "please input a file name:" file | |
cat <<- MENU | |
d or D:delete file | |
s or S:show file detail infomation | |
q or Q:quit | |
MENU | |
read -p "input your option:" option | |
case "$option" in | |
d|D) echo "delete $file" | |
rm "$file" ;; | |
s|S) ls -l "$file" ;; | |
q|Q) exit 0 ;; | |
*) echo "invalid option" | |
exit 1 ;; | |
esac | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment