Last active
August 17, 2016 13:35
-
-
Save alvarow/109f1d244624f67e38d684d30101b677 to your computer and use it in GitHub Desktop.
Bash default value environment variable that can be overridden
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 | |
: ${OVERRIDETHIS:="somedefault"} | |
echo ${OVERRIDETHIS} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sample output:
$ bash ./bash-var-default-value.sh somedefault $ OVERRIDETHIS="overridden" bash ./bash-var-default-value.sh overridden