最終更新:2017-02-17 (金) 17:36:32 (2624d)
getopts
Top / getopts
使い方
getopts "引数名" 変数名
例
- 引数に -a を指定したら opts 変数に中身(a)が入る
例
while getopts ad:h OPT do case $OPT in a) FLAG_A=1 ;; d) VALUE_D=$OPTARG ;; h) usage_exit ;; \?) usage_exit ;; esac done