Gentoo Archives: gentoo-user

From: Alan McKinnon <alan@××××××××××××××××.za>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] strange [ file
Date: Tue, 25 Jul 2006 14:38:58
Message-Id: 1153837999.19593.7.camel@localhost.localdomain
In Reply to: Re: [gentoo-user] strange [ file by Etaoin Shrdlu
1 On Tue, 2006-07-25 at 16:18 +0200, Etaoin Shrdlu wrote:
2 > > test and [ are not links to each other as they have different syntax
3 > > (the closing ]), so they cannot be the same command. If they were
4 > > linked, one of them would fail on execution with invalid syntax
5 > errors
6 >
7 > This is not 100% true. As Neil Bothwick said, *the same program* can
8 > behave differently based on the name it was invoked with, so [ could
9 > very well have been implemented as a link to test (or viceversa), but
10 > this is not the case, as you can see with a
11 > ls -l /usr/bin/test /usr/bin/[
12
13 Um, no. Read my post again. The command 'test' and the command '[' have
14 *different* syntax so cannot possible be links to each other and still
15 have it work. The command does behave differently depending on the name
16 it is called with, but this does not change the syntax used on the
17 command line that invokes it.
18
19 alan
20
21
22 --
23 gentoo-user@g.o mailing list

Replies

Subject Author
Re: [gentoo-user] strange [ file Etaoin Shrdlu <shrdlu@×××××××××××××.org>
Re: [gentoo-user] strange [ file Neil Bothwick <neil@××××××××××.uk>
Re: [gentoo-user] strange [ file Alexander Skwar <listen@×××××××××××××××.name>
Re: [gentoo-user] strange [ file Daniel da Veiga <danieldaveiga@×××××.com>