Created
February 13, 2014 15:02
-
-
Save jaymecd/8976571 to your computer and use it in GitHub Desktop.
Remove bash argument
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 | |
# | |
# Remove any argument matching --env= and prepend --env=test | |
# | |
args=("$@") | |
idx=0 | |
for arg in "${args[@]}"; do | |
if echo "$arg" | grep -i "^\-\-env=" >/dev/null; then | |
unset args[$idx] | |
fi | |
let idx++ | |
done | |
args=("--env=test" "${args[@]}") | |
other_app_to_call "${args[@]}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment