Skip to content

Instantly share code, notes, and snippets.

@SleeplessByte
Last active April 12, 2020 01:23
Show Gist options
  • Save SleeplessByte/ea551df4088d3629f2e5fddcce6b48ea to your computer and use it in GitHub Desktop.
Save SleeplessByte/ea551df4088d3629f2e5fddcce6b48ea to your computer and use it in GitHub Desktop.
Shell: forward arguments
#!/usr/bin/env bash
# Documentation on @
# https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html#index-_0040
# Documentation on shift [n]
# https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html#index-shift
# Why quoting the argument is "necessary":
# https://stackoverflow.com/questions/4824590/propagate-all-arguments-in-a-bash-shell-script/4824637#4824637
# eats 1 argument
shift 1
# forwards the rest to "forward_process"
forward_process "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment