#/bin/bash
ALL=false
HELP=false
FILE=false
VERBOSE=false
while getopts ahfvc OPTION
do
case $OPTION in
a)
ALL=true
echo "ALL IS $ALL"
;;
h)
HELP=true
echo "HELP is $HELP"
;;
f)
FILE=true
echo "FILE is $FILe"
;;
v)
VERBOSE=true
echo "VERBOSE is $VERBOSE"
;;
c)
echo "c value is $c"
;;
\?) echo "`basename $0`-[a h f v] -[c value] file"
;;
esac
done
shell-----getopts
最新推荐文章于 2024-06-21 18:24:50 发布