[csw-users] cswproto not found

Sebastian Kayser skayser at opencsw.org
Sat Mar 14 15:06:56 CET 2009


* Maciej Blizi??ski <maciej.blizinski at gmail.com> wrote:
> On Sat, Mar 14, 2009 at 10:32 AM, Roger Håkansson <hson at opencsw.org> wrote:
> > Are you sure that the CSW-version is the one you're using?
> > Whats your PATH?
> 
> This is amusing:
> 
> $ gmake --version
> GNU Make 3.80
> $ `which gmake` --version
> GNU Make 3.81
> 
> Wasn't the command "which" supposed to agree with what shell is doing?
> 
> My PATH is:
> 
> $ echo $PATH
> /opt/csw/sbin:/opt/csw/bin:/bin:/sbin:/usr/sbin:/usr/bin:/opt/SUNWjet/bin:/usr/sfw/bin:/usr/sfw/sbin:/usr/ccs/bin
> 
> I used findutils to track down all the 'gmake' files. The 3.80 version
> was from /usr/sfw directory. I'm positive I have /opt/csw/bin first in
> my PATH. "pkgrm SUNWgmake" fixed the problem.

I would guess that your shell had hashed the gmake from /usr/sfw/bin and
thus didn't pick up the gmake from /opt/csw/bin when you installed it
[1].

"which" is not a shell built-in and doesn't work with the shell hash
table for commands, so it will traverse the $PATH as usual (and find the
gmake from /opt/csw/bin as you had expected). Your current shell on the
other hand would have known where to find gmake based on a previous
call, when /opt/csw/bin/gmake wasn't yet available.

Rather use the shell built-in "type", which will apply the same logic as
your current shell (including the internal hash) to find a command. All
assuming you are using bash, other shells might behave similar.

Sebastian

[1]
http://www.gnu.org/software/bash/manual/bashref.html#Command-Search-and-Execution



More information about the users mailing list