[Top][All Lists]

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

Re: GNU Bash v.4.4.23-5 built-in function 'set' produces variable output

From: Chet Ramey
Subject: Re: GNU Bash v.4.4.23-5 built-in function 'set' produces variable outputs
Date: Wed, 24 Oct 2018 15:04:18 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

On 10/24/18 2:51 AM, Robert Elz wrote:

> I have complained about this (in private) to Chet before ... there are
> times when I want to run commands with a complely empty environment,
> but no matter how I try to make it go away, that _ keeps sticking its
> nose in...   The rest of what bash (by default) adds to the environ
> (like SHLVL as one example)  can be removed by unset, but not _
> (though "unset _" does not fail.)

Of course not -- it succeeds. Bash simply sets the variable again. This
is one of the special things about _.

> Note that it isn't really even following its doc, here, among its
> uses, this one would be from ...
>       expands to the last
>               argument to the previous command, after expansion.      
> which for the second "set | grep" above, was the previous
> "set | grep SSL" and the last arg there was "SSL" which should
> have matched the grep pattern.

Sloppy documenting, though ksh93 uses the same language: it really means
`simple command', and foreground simple commands at that.

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

reply via email to

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