Skip to content

Instantly share code, notes, and snippets.

@zipizap
Created October 11, 2013 14:22
Show Gist options
  • Save zipizap/6935448 to your computer and use it in GitHub Desktop.
Save zipizap/6935448 to your computer and use it in GitHub Desktop.
$env | grep VAR
# nothing
$ VAR1="my_v1" VAR2="my_v2" bash -c 'env | grep VAR'
VAR1=my_v1
VAR2=my_v2
# the command after VAR1 and VAR2 has those vars defined in its environment
# but the vars only exist in the environment of that command, and not in the
# "outside" environment, as can be seen:
$ env | grep VAR
# nothing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment