Lets assume I have some python argparse script which I would like to kind of alias using a bash function.
Let us assume this python script takes four arguments:
--arg1
--arg2
--arg3
--arg4
What I would like to achieve is taking the first two arguments at fixed positions, and after that to infinitely add the optional arguments.
function foo() { python3 script.py --arg1 "$1" --arg2 "$2" "$@"; }
So something like this:
foo value1 value2 --arg3 value3 --arg4 value4
However, $@ starts counting from 1.
How can I achieve this?