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: Mon, 12 Feb 2024 10:33:10 -0500
User-agent: Mozilla Thunderbird

On 2/11/24 7:11 PM, Christoph Anton Mitterer wrote:

(btw: would be nice if bash had a shopt to disable that exporting of
env vars with invalid shell var names... or is there one and I'm just
too blind to find it?)

"Environment variable names used by the utilities in the Shell and
Utilities volume of POSIX.1-2017 consist solely of uppercase letters,
digits, and the <underscore> ( '_' ) from the characters defined in
Portable Character Set and do not begin with a digit. Other characters may
be permitted by an implementation; applications shall tolerate the presence
of such names. "

Bash tolerates those names by passing them through to children in their
environment and not attempting to create shell variables from them.

--
``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/

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature


reply via email to

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