Op 28-02-2024 om 00:56 schreef Harald van Dijk:
However, trying to fix this I come across a corner case where it is not
clear to me what the intended behaviour is.
set -a; readonly foo=bar; export # some shells export, not all
IMO, the shell should export it in that case; POSIXly, 'set -a' should cause
the variable to be exported whenever a value is effectively assigned to it
(whether this is by a "true" shell assignment, an assignment-argument, an
expansion like ${foo=bar} or ${foo:=bar}, indirectly by 'read' or 'getopts',
or maybe other cases I'm not thinking of).
--
|| modernish -- harness the shell
|| https://github.com/modernish/modernish
||
|| KornShell lives!
|| https://github.com/ksh93/ksh