From owner-freebsd-bugs Sun Mar 10 6:50: 5 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 5D07237B400 for ; Sun, 10 Mar 2002 06:50:02 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g2AEo2F85178; Sun, 10 Mar 2002 06:50:02 -0800 (PST) (envelope-from gnats) Date: Sun, 10 Mar 2002 06:50:02 -0800 (PST) Message-Id: <200203101450.g2AEo2F85178@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Peter Pentchev Subject: Re: bin/35717: which(1) returns wrong exit status for multiple arguments Reply-To: Peter Pentchev Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR bin/35717; it has been noted by GNATS. From: Peter Pentchev To: wolfram schneider Cc: bug-followup@FreeBSD.org Subject: Re: bin/35717: which(1) returns wrong exit status for multiple arguments Date: Sun, 10 Mar 2002 16:41:14 +0200 On Sat, Mar 09, 2002 at 03:21:05PM -0800, wolfram schneider wrote: > > >Number: 35717 > >Category: bin > >Synopsis: which(1) returns wrong exit status for multiple arguments > >Originator: wolfram schneider > >Description: > The new c version of which(1) command returns wrong exit > status for multiple arguments. > > $ which foobar cat > /bin/cat > $ echo $? > 1 > > which should returns true if any of the arguments are found, > false if none are found. FWIW, this is consistent with the 'which' built-in command of csh, tcsh and zsh. Bash's 'type' built-in, though, returns 0 in this case, exactly as the Perl version of which(1) in RELENG_4 does. I do not know how this is with other shells; are there any standards on the return value of which(1)? G'luck, Peter -- Peter Pentchev roam@ringlet.net roam@FreeBSD.org PGP key: http://people.FreeBSD.org/~roam/roam.key.asc Key fingerprint FDBA FD79 C26F 3C51 C95E DF9E ED18 B68D 1619 4553 I had to translate this sentence into English because I could not read the original Sanskrit. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message