bug-bash
[Top][All Lists]
Advanced

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

Re: bash should not alter PATH with 'command -p'


From: Chet Ramey
Subject: Re: bash should not alter PATH with 'command -p'
Date: Thu, 04 Jun 2015 16:14:36 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.7.0

On 6/4/15 1:51 PM, Stephen Dowdy wrote:

>     $ PATH=/usr/sbin:/sbin:/usr/bin:/bin command -p env | grep ^PATH
>     PATH=/bin:/usr/bin
>     $ env | grep ^PATH
>    
> PATH=/usr/sbin:/sbin:/opt/bin:/opt/sbin:/usr/local/jdk:/home/sdowdy/bin:/sbin:/usr/sbin:/usr/local/sbin:/usr/local/bin:/bin:/usr/bin
> PATH in caller is still the same (correct), due to some side-effect of
> doing this in a pipeline.

Because pipeline elements are executed in subshells.

> 
> Again, thanks for the fix.  but, since i'm on Debian Stable, i'll see it in
> 3 years ;)

You can always download the git devel branch and compile your own.  This
code will be up there next week when I get back from vacation.


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



reply via email to

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