[gentoo-user] strange [ file

2006-07-25 Thread Arnau Bria
Hi, I've seen a file named [ in my /usr/bin ... #file [ [: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.4.1, dynamically linked (uses shared libs), for GNU/Linux 2.4.1, stripped in I can find things like: [...] -ot does not accept -l %s: unary operator expected %s:

Re: [gentoo-user] strange [ file

2006-07-25 Thread Dale
Arnau Bria wrote: Hi, I've seen a file named [ in my /usr/bin ... #file [ [: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.4.1, dynamically linked (uses shared libs), for GNU/Linux 2.4.1, stripped in I can find things like: [...] -ot does not accept -l %s:

Re: [gentoo-user] strange [ file

2006-07-25 Thread Richard Fish
On 7/25/06, Arnau Bria [EMAIL PROTECTED] wrote: Hi, I've seen a file named [ in my /usr/bin ... Perfectly normal. It is a program that implements bash style tests for script environments that don't normally do them. For example: if [ -f /etc/passwd ] ; then echo /etc/passwd exists and is

Re: [gentoo-user] strange [ file

2006-07-25 Thread Dirk Heinrichs
Am Dienstag, 25. Juli 2006 11:00 schrieb ext Arnau Bria: I've seen a file named [ in my /usr/bin ... [...] does any one know what could it be?¿ It's the [ from if [ condition ]; then ..., a shortcut for /usr/bin/test. HTH... Dirk -- Dirk Heinrichs | Tel: +49 (0)162 234

Re: [gentoo-user] strange [ file

2006-07-25 Thread Arnau Bria
On Tue, 25 Jul 2006 02:14:02 -0700 Richard Fish wrote: On 7/25/06, Arnau Bria [EMAIL PROTECTED] wrote: Hi, I've seen a file named [ in my /usr/bin ... Perfectly normal. It is a program that implements bash style tests for script environments that don't normally do them. For example:

Re: [gentoo-user] strange [ file

2006-07-25 Thread Christoph Eckert
does any one know what could it be?¿ AFAIK it's a synonym to »test«. Best regards ce -- gentoo-user@gentoo.org mailing list

Re: [gentoo-user] strange [ file

2006-07-25 Thread Neil Bothwick
On Tue, 25 Jul 2006 11:36:55 +0200, Arnau Bria wrote: I have a periodically rkhunter runnig in my system, but I was afraid I got a corrupted source package... Portage would refuse to install from a corrupted source package, because it verifies the checksums of all files it uses. -- Neil

Re: [gentoo-user] strange [ file

2006-07-25 Thread Alexander Skwar
Richard Fish wrote: On 7/25/06, Arnau Bria [EMAIL PROTECTED] wrote: Hi, I've seen a file named [ in my /usr/bin ... Perfectly normal. It is a program that implements bash style tests Not *bash* style tests. bash doesn't have much to do with this. for script environments that don't

Re: [gentoo-user] strange [ file

2006-07-25 Thread Alexander Skwar
Dirk Heinrichs wrote: Am Dienstag, 25. Juli 2006 11:00 schrieb ext Arnau Bria: I've seen a file named [ in my /usr/bin ... [...] does any one know what could it be?¿ It's the [ from if [ condition ]; then ..., a shortcut for /usr/bin/test. Nope, not correct. [09:39:58 [EMAIL

Re: [gentoo-user] strange [ file

2006-07-25 Thread Hagen Soengen
On Tue, 25 Jul 2006 13:02:48 +0200 Alexander Skwar [EMAIL PROTECTED] wrote: Dirk Heinrichs wrote: Am Dienstag, 25. Juli 2006 11:00 schrieb ext Arnau Bria: I've seen a file named [ in my /usr/bin ... [...] does any one know what could it be?¿ It's the [ from if [ condition ];

Re: [gentoo-user] strange [ file

2006-07-25 Thread Dirk Heinrichs
Am Dienstag, 25. Juli 2006 13:02 schrieb ext Alexander Skwar: Dirk Heinrichs wrote: Am Dienstag, 25. Juli 2006 11:00 schrieb ext Arnau Bria: I've seen a file named [ in my /usr/bin ... [...] does any one know what could it be?¿ It's the [ from if [ condition ]; then ..., a shortcut

Re: [gentoo-user] strange [ file

2006-07-25 Thread Neil Bothwick
On Tue, 25 Jul 2006 11:00:38 +0200, Arnau Bria wrote: I've seen a file named [ in my /usr/bin ... [ is a synonym for the test command, see man test for details. This file isn't normally used, because [ and test are builtins in Bash. -- Neil Bothwick Some day my ship will come in, but with

Re: [gentoo-user] strange [ file

2006-07-25 Thread Neil Bothwick
On Tue, 25 Jul 2006 12:26:53 +, Hagen Soengen wrote: I wonder where the differences are. I would've expected that test and [ were hardlinks. # /usr/bin/[ /usr/bin/[: missing ']' # /usr/bin/test no output # You see? They cant be the same, because the closing ] is

Re: [gentoo-user] strange [ file

2006-07-25 Thread Mauro Faccenda
On Tuesday 25 July 2006 09:20, Neil Bothwick wrote: On Tue, 25 Jul 2006 12:26:53 +, Hagen Soengen wrote: I wonder where the differences are. I would've expected that test and [ were hardlinks. # /usr/bin/[ /usr/bin/[: missing ']' # /usr/bin/test no output # You

Re: [gentoo-user] strange [ file

2006-07-25 Thread Neil Bothwick
On Tue, 25 Jul 2006 09:26:52 -0300, Mauro Faccenda wrote: You see? They cant be the same, because the closing ] is needed by /usr/bin[ and not by /usr/bin/test It's quite common for a program to change its behaviour according to the name used to run it. For example, zcat and gunzip

Re: [gentoo-user] strange [ file

2006-07-25 Thread Alan McKinnon
On Tue, 2006-07-25 at 14:16 +0100, Neil Bothwick wrote: On Tue, 25 Jul 2006 09:26:52 -0300, Mauro Faccenda wrote: You see? They cant be the same, because the closing ] is needed by /usr/bin[ and not by /usr/bin/test It's quite common for a program to change its behaviour according

Re: [gentoo-user] strange [ file

2006-07-25 Thread Etaoin Shrdlu
On Tuesday 25 July 2006 15:41, Alan McKinnon wrote: The answer is simple: 'test' is a bash builtin. When a bash script executes 'test', it is not /usr/bin/test that runs, but a function internal to bash. /usr/bin/test/ is provided for environments that want to run bash scripts that use

Re: [gentoo-user] strange [ file

2006-07-25 Thread Alexander Skwar
Alan McKinnon wrote: On Tue, 2006-07-25 at 14:16 +0100, Neil Bothwick wrote: On Tue, 25 Jul 2006 09:26:52 -0300, Mauro Faccenda wrote: You see? They cant be the same, because the closing ] is needed by /usr/bin[ and not by /usr/bin/test It's quite common for a program to change

Re: [gentoo-user] strange [ file

2006-07-25 Thread Alexander Skwar
Neil Bothwick wrote: On Tue, 25 Jul 2006 09:26:52 -0300, Mauro Faccenda wrote: You see? They cant be the same, because the closing ] is needed by /usr/bin[ and not by /usr/bin/test It's quite common for a program to change its behaviour according to the name used to run it. For

Re: [gentoo-user] strange [ file

2006-07-25 Thread Etaoin Shrdlu
On Tuesday 25 July 2006 15:16, Neil Bothwick wrote: I was disagreeing with the cant be the same comment. I know they are different files, but the slightly different behaviour is insufficient reason for that. Alexander asked why one was not a link to the other, I'd like to know too, but this

Re: [gentoo-user] strange [ file

2006-07-25 Thread Neil Bothwick
On Tue, 25 Jul 2006 15:41:56 +0200, Alan McKinnon wrote: The answer is simple: Maye, but this isn't it. 'test' is a bash builtin. When a bash script executes 'test', it is not /usr/bin/test that runs, but a function internal to bash. test and [ are both Bash builtins, but there are also [

Re: [gentoo-user] strange [ file

2006-07-25 Thread Alan McKinnon
On Tue, 2006-07-25 at 16:18 +0200, Etaoin Shrdlu wrote: test and [ are not links to each other as they have different syntax (the closing ]), so they cannot be the same command. If they were linked, one of them would fail on execution with invalid syntax errors This is not 100% true. As

Re: [gentoo-user] strange [ file

2006-07-25 Thread Etaoin Shrdlu
On Tuesday 25 July 2006 16:33, Alan McKinnon wrote: Um, no. Read my post again. The command 'test' and the command '[' have *different* syntax so cannot possible be links to each other and still have it work. The command does behave differently depending on the name it is called with, but

Re: [gentoo-user] strange [ file

2006-07-25 Thread Neil Bothwick
On Tue, 25 Jul 2006 16:33:19 +0200, Alan McKinnon wrote: Um, no. Read my post again. The command 'test' and the command '[' have *different* syntax so cannot possible be links to each other and still have it work. if [ $(basename $0) == [ ] then #parse for trailing ] else

Re: [gentoo-user] strange [ file

2006-07-25 Thread Alexander Skwar
Alan McKinnon schrieb: On Tue, 2006-07-25 at 16:18 +0200, Etaoin Shrdlu wrote: test and [ are not links to each other as they have different syntax (the closing ]), so they cannot be the same command. If they were linked, one of them would fail on execution with invalid syntax errors This

Re: [gentoo-user] strange [ file

2006-07-25 Thread Daniel da Veiga
On 7/25/06, Alan McKinnon [EMAIL PROTECTED] wrote: On Tue, 2006-07-25 at 16:18 +0200, Etaoin Shrdlu wrote: test and [ are not links to each other as they have different syntax (the closing ]), so they cannot be the same command. If they were linked, one of them would fail on execution with