[Bash]: Check if environment variables are set and if not assign them a default value.
env_variable=$(printenv ENV_VAR)
variable=${env_variable:-"my default value"}
Written by Esteban
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#