Created
December 7, 2019 18:26
-
-
Save wwalker/7d79329efc0985c26a8d22a940008e9f to your computer and use it in GitHub Desktop.
bash args
This file contains hidden or 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
#!/bin/bash | |
args=() | |
arg_parser(){ | |
shift | |
shift | |
while (( $# > 0 )); do | |
args+=("$1") | |
shift | |
done | |
echo "${args[@]}" | |
} | |
arg_parser "$@" | |
echo "${args[@]}" | |
set -- "${args[@]}" | |
echo "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment