【发布时间】:2021-12-27 13:17:42
【问题描述】:
使用getopt 已有一段时间了。我正在研究一个选项有两个参数值的可能性。这很好吗?可以用getopt 做到这一点。举个例子会有所帮助。
做了一些测试,发现这样做
myfunc -S 13 21
给予
opts: -S '13' -- '21'
在哪里
opts=$( getopt -o "$shortopts" -l "$longopts" -n "${0##*/}" -- "$@" )
因此 getopt 无法接受myfunc -S 13 21。
【问题讨论】:
-
一个你想要实现的例子也会有所帮助.....