Subject: Re: /usr/bin/which is a csh script!!?!
To: NetBSD-current Discussion List <current-users@NetBSD.ORG>
From: Greg A. Woods <woods@weird.com>
List: current-users
Date: 04/30/2003 14:44:30
[ On Wednesday, April 30, 2003 at 19:05:41 (+0100), Ben Harris wrote: ]
> Subject: Re: /usr/bin/which is a csh script!!?!
>
> In article <20030430090531.Q26297@snowdrop.l8s.co.uk> you write:
> >> 	# NOTE:  If this were a ksh script then it could just call "command -v"
> >
> >Which also works in /bin/sh since it is required by posix.
> 
> Which POSIX?  IEEE Std 1003.1-2001 certainly doesn't include it, and neither
> does IEEE Std 1003.2-1992.

I think it was "command -v" being referred to there...

Perhaps the rationale from P1003.2a-D8 will help explain to everyone
what which is where:

 BEGIN_RATIONALE

 Rationale._(This_subclause_is_not_a_part_of_P1003.2a)

 The command -v and -V options were added to the UPE to satisfy
 requirements from users that are currently accomplished by three
 different historical utilities:  type in the System V shell, whence in
 the KornShell, and which in the C-shell.  Since there is no historical
 agreement on how and what to accomplish here, the POSIX command utility
 was enhanced and the historical utilities were left unmodified.  The C-
 shell which merely conducts a path search.  The KornShell whence is more
 elaborate--in addition to the categories required by POSIX, it also
 reports on tracked aliases, exported aliases, and undefined functions.

It goes on to talk about '-v' vs. '-V', the execution environment, types
of builtins, etc....

-- 
								Greg A. Woods

+1 416 218-0098;            <g.a.woods@ieee.org>;           <woods@robohack.ca>
Planix, Inc. <woods@planix.com>; VE3TCP; Secrets of the Weird <woods@weird.com>