这是我的shell脚本-
if ! options=$(getopt -o : -l along:,blong:,clong: -- "$@")
then
# something went wrong, getopt will put out an error message for us
exit 1
fi
set -- $options
while [ $# -gt 0 ]
do
case $1 in
--along) echo "--along selected :: $2" ;;
--blong) echo "--blong selected :: $2" ;;
--clong) echo "--clong selected :: $2" ;;
esac
shift
done
当我运行脚本时,我得到以下输出 -
./test.sh --along hi --blong hello --clong bye
--along selected :: 'hi'
--blong selected :: 'hello'
--clong selected :: 'bye'
问题是我不想用单引号('hi','hello','bye')显示参数。我应该怎么做才能摆脱那些引号?