Skip to content

Instantly share code, notes, and snippets.

@dekokun
Created December 7, 2011 11:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dekokun/1442506 to your computer and use it in GitHub Desktop.
Save dekokun/1442506 to your computer and use it in GitHub Desktop.
シェルスクリプトのオプションとって、なんかそれっぽく処理してくれる記述
usage()
{
echo
echo -e >&2 "\tUsage: $0 [-f]"
echo -e "\t\t-f It's usage hogehoge !!!"
echo
}
while getopts "hf" flag
do
case $flag in
\?) usage;exit 1;;
h) usage;exit 1;;
f) OPT_F=true;;
esac
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment