Skip to content

Instantly share code, notes, and snippets.

@holys
Forked from anonymous/case.sh.txt
Last active December 11, 2015 00:29
Show Gist options
  • Save holys/4516698 to your computer and use it in GitHub Desktop.
Save holys/4516698 to your computer and use it in GitHub Desktop.
#!/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
@holys
Copy link
Author

holys commented Jan 12, 2013

cat << DataTag
This is usually used as a menu 
DataTag

@holys
Copy link
Author

holys commented Jan 12, 2013

感觉用gist做笔记什么的挺不错的! 随时记录 ! 还可以修改, 还有代码高亮!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment