Op 08-07-19 om 00:59 schreef Robert Elz:
[...]
No-one is doubting the effect of the
export command upon the shell itself.
What is in question is what should actually be placed in the environment
when an unset, but exported, variable exists in the shell, and some other
command is invoked.
Exactly right, thank you.
After Jilles' reply, it looks like there's a strong consensus for
"nothing" among shell implementers.
What needs to change is to perhaps add "if set" into the "shall cause them
to be exported of" words, making
which shall cause them to be, if set, in the environment of
subsequently executed commands.
IMHO, that's still not clear enough; this could be interpreted to say
that it should be added to the environment if it is set at the time the
'export' command is run. What shell implementations actually do is add a
variable whose name was previously given the export flag to the
environment the moment it acquires a value, whenever that may be.
I think the only way to make that really clear is to leave the phrase
you quoted as is and add another one, something like
If a /name/ is unset and not followed by =/word/, then its
/export/ attribute shall be remembered without otherwise
affecting its state, and shall take effect if and when the
corresponding variable is set.
Thanks,
- M.
--
modernish -- harness the shell
https://github.com/modernish/modernish