Re:No Ghosts
by jakewins on Friday December 02, 2022 @06:55AM
(#33829346)
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
Re:No Ghosts
by bkfunk on Friday December 02, 2022 @09:40AM
(#33830981)
The 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.
> 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