[英]What is the difference between ? and * in Bash?
因此,您知道自己執行標准的getopts
設置:
while getopts :a:bc option
do
case "${option}"
in
a)
# do a manditory thing!
;;
b)
# do a optional thing!
;;
c)
# for real, you usually would set variables using getopts
;;
?) # unexpected flag(?)
echo "FATAL: Unexpected flag ${OPTARG}"
exit 2
;;
*) # litterally nothing entered(?)
show_help
exit 1
;;
esac
done
據我所知, ?
是用於定義的標志以外的標志, *
是用於未輸入任何參數的標志。 但是,我不確定...
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.