Skip to content

Instantly share code, notes, and snippets.

@wwalker
Created December 7, 2019 18:26
Show Gist options
  • Save wwalker/7d79329efc0985c26a8d22a940008e9f to your computer and use it in GitHub Desktop.
Save wwalker/7d79329efc0985c26a8d22a940008e9f to your computer and use it in GitHub Desktop.
bash args
#!/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