help-bash
[Top][All Lists]
Advanced

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

Re: why does </proc/self/environ not work in bash?


From: Chet Ramey
Subject: Re: why does </proc/self/environ not work in bash?
Date: Tue, 13 Feb 2024 09:33:31 -0500
User-agent: Mozilla Thunderbird

On 2/12/24 3:49 PM, Zachary Santer wrote:
On Mon, Feb 12, 2024 at 2:56 PM Chet Ramey <chet.ramey@case.edu <mailto:chet.ramey@case.edu>> wrote:

    POSIX makes that explicitly unspecified. Is it worth breaking backwards
    compatibility for?


Would it affect something other than side-effects from arithmetic expansions still being present in the shell? I guess also ${parameter:=word}. It would be so weird for a script to be dependent on this behavior. Why use an arithmetic expansion that would normally have side effects unless you wanted those side-effects to occur?

Consider what would happen if you used $RANDOM in one of those expansions
and the behavior changed. That's certainly going to affect the random
sequence in the parent shell.

Even more so for the assign default values parameter expansion. This is such a funky edge case that the user even being aware of it in the first place seems like a pretty big ask.

This sounds like another case of "I can't imagine it happening, so it must
not be happening."

Bash has behaved this way forever, and this isn't convincing enough to
change that aspect of its behavior.

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]