有没有简单的方法可以将命名参数传递(接收)到Shell脚本?
例如,
my_script -p_out '/some/path' -arg_1 '5'
并在内部my_script.sh
将其接收为:
# I believe this notation does not work, but is there anything close to it?
p_out=$ARGUMENTS['p_out']
arg1=$ARGUMENTS['arg_1']
printf "The Argument p_out is %s" "$p_out"
printf "The Argument arg_1 is %s" "$arg1"
在Bash或Zsh中可能吗?