coreutils
[Top][All Lists]
Advanced

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

Re: env: can it be used to let only certain variables through (if they'r


From: Christoph Anton Mitterer
Subject: Re: env: can it be used to let only certain variables through (if they're set)?
Date: Sat, 22 Jan 2022 22:30:11 +0100
User-agent: Evolution 3.42.2-1

On Fri, 2022-01-21 at 15:56 +0000, Pádraig Brady wrote:
> Another thing to consider for including everything on a shebang line
> is system limits (127 bytes on linux for example)

btw: That seem to have been increased with commit
6eb3c3d0a52dca337e327ae8868ca1f44a712e02 to 256.

And in the mail thread back then, they even seemed to be open to
increase that further.


So that would give a bit more space to work with.

And in principle env might be extended like the following:

E.g. adding a -X <integer> option, where X is to be replaced with some
more suitable letter and integer is a bitmask, that allows to choose
from certain standard sets of variables that (if set) are passed on as
is, e.g.:

0x0000: all disabled
0x0001: PATH, PWD      (from POSIX, "base set")
0x0010: HOME, LOGNAME  (from POSIX, user related)
0x0100: SHELL, TERM    (from POSIX, where the program runs in)
0x1000: LANG, LC_ALL, LC_COLLATE, LC_CTYPE, LC_MESSAGES, LC_MONETARY,
        LC_NUMERIC, LC_TIME, TZ
                       (from POSIX, locale related)


0x00010000: LANGUAGE, LC_ADDRESS, LC_IDENTIFICATION, LC_MEASUREMENT,
            LC_NAME, LC_PAPER, LC_TELEPHONE
                       (from GNU, more locale related)


Each set would need to be clearly defined, and whether or not it could
be extended in the future.
E.g. the locale related sets might be extended in the future with other
LC_ vars, but one couldn't suddenly add e.g. POSIXLY_CORRECT to 0x0001,
because people might just rely on that this is blocked.

Also one probably shouldn't glob, e.g. let through any LC_* vars.


Cheers,
Chris.



reply via email to

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