Gentoo Archives: gentoo-user

From: Mauro Faccenda <faccenda@×××.net>
To: gentoo-user@l.g.o
Cc: Neil Bothwick <neil@××××××××××.uk>
Subject: Re: [gentoo-user] strange [ file
Date: Tue, 25 Jul 2006 12:40:23
Message-Id: 200607250926.52868.faccenda@gmx.net
In Reply to: Re: [gentoo-user] strange [ file by Neil Bothwick
1 On Tuesday 25 July 2006 09:20, Neil Bothwick wrote:
2 > On Tue, 25 Jul 2006 12:26:53 +0000, Hagen Soengen wrote:
3 > > > I wonder where the differences are. I would've expected that test and
4 > > > [ were hardlinks.
5 > >
6 > > # /usr/bin/[
7 > > /usr/bin/[: missing ']'
8 > > # /usr/bin/test
9 > > <no output>
10 > > #
11 > >
12 > > You see? They cant be the same, because the closing "]" is needed
13 > > by /usr/bin[ and not by /usr/bin/test
14 >
15 > It's quite common for a program to change its behaviour according to the
16 > name used to run it. For example, zcat and gunzip are links to gzip, yet
17 > the three programs behave differently.
18
19 but this isn't the case:
20
21 $ sha1sum /usr/bin/\[ /usr/bin/test
22 2d3a938b84db7107e323ac85a9bf4f351721da7b /usr/bin/[
23 1b126dd3e41a2a9d4554879647f73fdf49d29479 /usr/bin/test
24
25 $ sha1sum /bin/zcat /bin/gzip /bin/gunzip
26 708011af43a41f6e3120e96eacb6ac4bba8717ee /bin/zcat
27 708011af43a41f6e3120e96eacb6ac4bba8717ee /bin/gzip
28 708011af43a41f6e3120e96eacb6ac4bba8717ee /bin/gunzip
29
30 []'s
31 .m
32 --
33 gentoo-user@g.o mailing list

Replies

Subject Author
Re: [gentoo-user] strange [ file Neil Bothwick <neil@××××××××××.uk>