Reputation: 7755
When called as my_cmd -a -b ... c
,
the script will finally call program a
with addition parameters:
a -additional -a -b ... c
How can I write such a bash script?
Upvotes: 0
Views: 229
Reputation: 1750
If the command's name "a" has to be also taken from the my_cmd's parameters:
"${1:1}" -additional "$@"
Upvotes: 0
Reputation: 755026
Given that the additional arguments come immediately after the command, it is trivial:
exec a -additional "$@"
The exec
is optional.
Upvotes: 1