Re: wrong behaviour when unsetting/setting some variables

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

 



Op 29-02-2024 om 18:56 schreef Harald van Dijk:
Good point, though by special-casing getopts and read, it kind of implies that it does not apply to other commands and utilities.

I'd forgotten I'd filed an Austin Group bug for this about two years ago:
https://www.austingroupbugs.net/view.php?id=1555

It was resolved that the text in the next version of the standard will be:

| Set the export attribute for all variable assignments. When this option
| is on, whenever a value is assigned to a variable in the current shell
| execution environment, the export attribute shall be set for the variable.
| This applies to all forms of assignment, including those made as a
| side-effect of variable expansions or arithmetic expansions, and those made
| as a result of the operation of the cd, getopts, or read utilities.
|
| <small>Note: As discussed in Section 2.9.1, not all variable assignments
| happen in the current execution environment. When an assignment happens in
| a separate shell execution environment, the export attribute is still set
| for the variable, but that does not affect the current shell execution
| environment.</small>

HTH.

--
||	modernish -- harness the shell
||	https://github.com/modernish/modernish
||
||	KornShell lives!
||	https://github.com/ksh93/ksh





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

  Powered by Linux