3 ms·
In my example I set the env var on the same line as the command, so the env var is only set in the new process, per open group: > If the command name is not a
by jakewins 4y ago
In my example I set the env var on the same line as the command, so the env var is only set in the new process, per open group:
> If the command name is not a special built-in utility or function, the variable assignments shall be exported for the execution environment of the command and shall not affect the current execution environment
Eg
FOO=bar myapp
FOO=xyz myapp
echo $FOO # prints empty string/newline
- bkfunk 4y agoThe issue is, can myapp know that it was set that way, vs being set somewhere else? The command line argument uses syntactical constraints to ensure that the value of the argument was set specifically with the intention of using it in myapp.