bdeferme wrote:
Tom Grove <[EMAIL PROTECTED]> wrote:

Hello all...I am new to this Debian thing :-)  I used it in the Woody
days but moved over to the FreeBSD world for the last few years.  I
recently installed Testing (Lenny) and see the left bracket in my
/usr/bin directory and do not know what it is.  When I ls -al it I get:

-rwxr-xr-x 1 root root 24752 2007-01-30 13:51 /usr/bin/[

This leads me to believe that it was installed with the base system or
some package because I just installed the system earlier this week.
Any help is much appreciated.  Thanks.

-Tom Grove

Weird,
Why don't you try to run it and see what it is?

P.S. Don't run it as root, just to be sure :-)

[EMAIL PROTECTED]
www.paradize.be



--To UNSUBSCRIBE, email to [EMAIL PROTECTED] a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]


I'm not sure why 'test' and '[' exist as separate files, today. In the 'old' days, '[' and 'test' were simply hard links to the same file. This allowed the code to look at the name used to run it and set some specific default behaviors. The most important of these was that the name '[' required a final argument of ']'. This was done to make shell scripting cleaner and easier to read.

Today, most shells have these built in, so there's no exec overhead to worry about, so performance is improved. But this now means you have to worry about quoting and escape processing. Old Bourne shells didn't have these built in, so it didn't try to interpret them and escaping was not needed.

Other responses to this question have included a number of command line examples with various amounts of escaping applied. I have some comments on those:

1. ls /usr/bin/[ and ls /usr/bin/\[ are identical (the escape is not needed). This is because the shell only treats '[' specially when it is stand alone. And ls itself doesn't process special characters.

2. When the command in question does do regex processing, it is much easier to escape the string from the shell with single quotes than with multiple backslashes.

  dpkg -S '/usr/bin\['

is much easier to read (and type correctly), than

  dpkg -S /usr/bin/\\\[

Bob

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to