[Top][All Lists]

[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: Tue, 02 Jun 2015 10:56:59 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.7.0

On 5/28/15 3:59 PM, address@hidden wrote:

> Bash Version: 4.3
> Patch Level: 30
> Release Status: release
> Description:

> 'command -p' 
>     Ref:http://pubs.opengroup.org/onlinepubs/009696699/utilities/command.html
>     "... -p Perform the command search using a default value for PATH that is 
> guaranteed to find all of the standard utilities. ..."
>     The way i read that is:
>         "search for a command only in a default PATH location, then invoke it 
> (not altering user environment in the process)"
>     The way 'bash' seems to be looking at that is:
>         "set the user's PATH to a default value, then invoke"

Kind of.  It's more like `command -p foo args' is turned into
PATH=stdpath foo args
where the new PATH survives only for the duration of the command.  It's
probably not the spirit of the -p option, though it's been this way for
many years.  I will take a look and see what can be done.


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

reply via email to

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