Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Dec 1999 11:05:35 +1100
From:      Peter Jeremy <peter.jeremy@alcatel.com.au>
To:        David Wolfskill <dhw@whistle.com>
Cc:        freebsd-stable@FreeBSD.ORG
Subject:   Re: /bin/test broken ?
Message-ID:  <99Dec24.105638est.40325@border.alcanet.com.au>
In-Reply-To: <199912232030.MAA65714@pau-amma.whistle.com>; from dhw@whistle.com on Fri, Dec 24, 1999 at 07:30:03AM %2B1100
References:  <99Dec23.123516est.40332@border.alcanet.com.au> <199912232030.MAA65714@pau-amma.whistle.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 1999-Dec-24 07:30:03 +1100, David Wolfskill <dhw@whistle.com> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?99Dec24.105638est.40325>