Re: wrong behaviour when unsetting/setting some variables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2024-02-27 at 02:53 -0500, Lawrence Velázquez wrote:
> That's my understanding:  Environment variables must have values
> (even empty ones), so unset shell variables cannot be placed into
> the environment.  One might propose that a valueless environment
> variable could be represented as "name", but the standard requires
> that environment strings contain a "=".

And yet:
> The shell shall give the export attribute to the variables
> corresponding to the specified names, which shall cause them to be
> in the environment of subsequently executed commands.

would IMO mean that export attribute alone decides whether it's
exported or not - not whether it has a set value.

Unless set -u is given an expanded unset shell variable would give the
empty string, so one could say that the similar concept would apply
when the shell exports a variable that has the export attribute but no
set value.


Maybe I should open a ticket at austinbugs, asking for clarification.
Perhaps also for the issue that Harald pointed out in his mail (about
set -a + readonly).


Cheers,
Chris.






[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux