From owner-freebsd-stable Thu Dec 23 16: 5:57 1999 Delivered-To: freebsd-stable@freebsd.org Received: from alcanet.com.au (border.alcanet.com.au [203.62.196.10]) by hub.freebsd.org (Postfix) with ESMTP id 9058C14D22 for ; Thu, 23 Dec 1999 16:05:53 -0800 (PST) (envelope-from jeremyp@gsmx07.alcatel.com.au) Received: by border.alcanet.com.au id <40325>; Fri, 24 Dec 1999 10:56:38 +1100 Content-return: prohibited Date: Fri, 24 Dec 1999 11:05:35 +1100 From: Peter Jeremy Subject: Re: /bin/test broken ? In-reply-to: <199912232030.MAA65714@pau-amma.whistle.com>; from dhw@whistle.com on Fri, Dec 24, 1999 at 07:30:03AM +1100 To: David Wolfskill Cc: freebsd-stable@FreeBSD.ORG Message-Id: <99Dec24.105638est.40325@border.alcanet.com.au> MIME-version: 1.0 X-Mailer: Mutt 1.0i Content-type: text/plain; charset=us-ascii References: <99Dec23.123516est.40332@border.alcanet.com.au> <199912232030.MAA65714@pau-amma.whistle.com> Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On 1999-Dec-24 07:30:03 +1100, David Wolfskill wrote: >>That said, the error message should have been: >> test: ]: unexpected operator >>and it is not clear why you are getting `[' reported as the program >>name. > >Well, /bin/test and /bin/[ are links to the same inode: Agreed, but the error message is printed by errx(3). errx(3) prints __progname (which is effectively equivalent to argv[0]) as the program name - ie the name by which the program was invoked. test(1) includes a check near the beginning to see it it was invoked as `[' and if it was it checks to see that the last argument is `]' and deletes it if it was. In both cases, the remaining arguments are then passed to the expression evaluator. Peter To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message