是否有一些内置工具可以识别-x和--xxxx作为开关,而不是参数,或者您是否必须遍历所有输入变量,测试破折号,然后解析参数?
-x
--xxxx
shell options shell-script getopts
getopts ×1
options ×1
shell ×1
shell-script ×1