From owner-freebsd-bugs@FreeBSD.ORG Thu Jul 29 22:40:03 2010 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D4021065679 for ; Thu, 29 Jul 2010 22:40:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id E5D5E8FC17 for ; Thu, 29 Jul 2010 22:40:02 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o6TMe21D098271 for ; Thu, 29 Jul 2010 22:40:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o6TMe2u9098270; Thu, 29 Jul 2010 22:40:02 GMT (envelope-from gnats) Date: Thu, 29 Jul 2010 22:40:02 GMT Message-Id: <201007292240.o6TMe2u9098270@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Jilles Tjoelker Cc: Subject: Re: bin/35717: which(1) returns wrong exit status for multiple arguments X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Jilles Tjoelker List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Jul 2010 22:40:03 -0000 The following reply was made to PR bin/35717; it has been noted by GNATS. From: Jilles Tjoelker To: bug-followup@FreeBSD.org, wosch@FreeBSD.org Cc: Subject: Re: bin/35717: which(1) returns wrong exit status for multiple arguments Date: Fri, 30 Jul 2010 00:30:20 +0200 > [5.x's /usr/bin/which returns 1 if any argument is not found, instead > of only when all arguments are not found like 4.x's] The new behaviour seems consistent with what most other utilities do (if an error occurs processing an argument, processing continues with the next argument but the exit status will be non-zero). POSIX mentions this in "Consequences of Errors" in XCU 1.4 Utility Description Defaults. Following this for non-standard utilities is not a requirement but makes things more consistent. There is no standard for which(1). The closest is probably the tcsh(1) builtin which behaves like the new /usr/bin/which. There seems little reason to change. -- Jilles Tjoelker