bash getopts example
while getopts ":a:b:c" Option
# Initial declaration.
#
do
case $Option in
# w ) CMD=$OPTARG; FILENAME="PIMSLogList.txt"; TARGET="logfiles"; ;;
a) a=$OPTARG ;;
d ) b=$OPTARG ;;
c ) c=FlogForCInOn ;;
* ) echo "Usage $basename -a A -b B -c arguments"
esac
done
shift $(($OPTIND - 1))
# now deal with the arguments
No comments:
Post a Comment