Last active
April 12, 2020 01:23
-
-
Save SleeplessByte/ea551df4088d3629f2e5fddcce6b48ea to your computer and use it in GitHub Desktop.
Shell: forward arguments
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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