I want to clarify a confusion I am having in shell variable vs environment variable. I did the following test, where I have a shell variable
export it to an environment variable.
$ $ abc="shell var" $ env | grep abc $ echo $abc shell var $ export abc="env var" $ env | grep abc abc=env var $ echo $abc env var $ unset abc $ env | grep abc $ echo $abc $
After the export is done, I try to
Does export move the variable
abcfrom shell to the environment OR does it create a copy in the environment and assign it a new value ?
When the second
echois done after the
abcis in environment and then print it, OR has
abcbeen completely removed from the shell and is only present in the environment which is why
echoprints its value ?