linux下shell管理9个以下参数选项

 

#!/bin/sh

#set var

ALL=false
HELP=false
FILE=false
CONFIG=0

while getopts ahf:c:  OPTION
do
	case $OPTION in
	a)ALL=true
	echo "ALLL is $ALL"
	;;
	h)HELP=true
	echo "HELP is $HELP"
	;;
	f)FILE=true
	echo "FILE is $FILE"
	;;
	c)CONFIG=$OPTARG
	echo "CONFIG is $CONFIG"
	;;
	\?)
	echo "good bye!"
	;;
	esac
done

你可能感兴趣的:(linux)