How do I forward parameters to other command in bash script?

bash, command-line

Solution

Use the `shift` built-in command to "eat" the arguments. Then call the child process and pass it the `"$@"` argument to include all remaining arguments. Notice the quotes, they should be kept, since they cause the expansion of the argument list to be properly quoted.

Problem

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?

Original source