bin/35717: which(1) returns wrong exit status for multiple
arguments
Jilles Tjoelker
jilles at stack.nl
Thu Jul 29 22:40:03 UTC 2010
The following reply was made to PR bin/35717; it has been noted by GNATS.
From: Jilles Tjoelker <jilles at stack.nl>
To: bug-followup at FreeBSD.org, wosch at 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
More information about the freebsd-bugs
mailing list