bash getopts - $ {OPTARG}和$ OPTARG之间的差异

时间:2015-04-03 18:07:30

标签: linux bash getopts

将参数传递给Bash脚本时,如:

1   while getopts u:d:p:f: option 
2   do 
3   case "${option}" in 
4   u) USER=${OPTARG};; 
5   d) DATE=${OPTARG};; 
6   p) PRODUCT=${OPTARG};; 
7   f) FORMAT=$OPTARG;; 
8   esac 
9   done

来自:http://linux.about.com/od/Bash_Scripting_Solutions/a/How-To-Pass-Arguments-To-A-Bash-Script.htm

{4-}行4-5-6和${OPTARG};;第7行有什么区别?

0 个答案:

没有答案