|
From: | Stephen Dowdy |
Subject: | Re: bash should not alter PATH with 'command -p' |
Date: | Tue, 2 Jun 2015 09:27:53 -0600 |
On 5/28/15 3:59 PM, sdowdy@rap.ucar.edu 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.
Chet
--
``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/
[Prev in Thread] | Current Thread | [Next in Thread] |