原文:使用getopts
的Bash函数仅在第一次运行时起作用
f () {
while getopts ":a:" opt; do
case $opt in
a)
echo "-a was triggered, Parameter: $OPTARG" >&2
;
原文:使用getopts
的Bash函数仅在第一次运行时起作用
f () {
while getopts ":a:" opt; do
case $opt in
a)
echo "-a was triggered, Parameter: $OPTARG" >&2
;