【发布时间】:2020-03-30 08:28:24
【问题描述】:
myfunc ()
{
if [${*: -1} == "some argument"]
then
command anotherCommand "$@"
elif [ ... ]
...
fi
}
如何更改"$@",使其将所有参数传递给anotherCommand除了最后一个?
【问题讨论】:
-
为什么不改变接口,让要检查的参数是第一个参数?
标签: bash arguments parameter-passing