Inside my bash script, I would like to parse zero, one or two parameters (the script can recognize them), then forward the remaining parameters to a command invoked in the script. How can I do that?
bash uses the shift command:
e.g. shifttest.sh:
#!/bin/bash
echo $1
shift
echo $1 $2
shifttest.sh 1 2 3 produces
1
2 3