Skip to content

Instantly share code, notes, and snippets.

@element6
Created June 5, 2017 01:27
Show Gist options
  • Save element6/6d419dcc4f1413f96c7aca1bb6788122 to your computer and use it in GitHub Desktop.
Save element6/6d419dcc4f1413f96c7aca1bb6788122 to your computer and use it in GitHub Desktop.
use env var in command line
FOO=${VARIABLE:-default}
Or, which will assign to VARIABLE as well:
FOO=${VARIABLE:=default}
LOC=; eval "echo ${LOC:=en}; echo $LOC"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment