Re: Stupid bash question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



At 12:05 PM -0500 12/11/07, Joe Smith wrote:
>Mikkel L. Ellertson wrote:
>> One thing that would probably help your understanding is that [ is
>> actually a command. It is usually a shell built-in command, but it
>> is also a command in /usr/bin, and is the same as the test command.
>> ...
>
>Mmm, curious. I wonder why are they /not/ the same command?
>
>$ type [ test
>[ is a shell builtin
>test is a shell builtin
>$ ls -li /usr/bin/{[,test}
>1234416 -rwxr-xr-x 1 root root 31404 2007-12-05 08:25 /usr/bin/[
>1234972 -rwxr-xr-x 1 root root 29032 2007-12-05 08:24 /usr/bin/test
>
>I always thought that [ and test were links to the same binary.
>
>I guess disk blocks aren't as precious as they once were ;-)

The reason seems weak to me, but test does not require a closing square
bracket, while [ does, and:

At 6:22 PM +0200 5/11/07, Stepan Kasal wrote:
>Hi,
>
>On Fri, May 11, 2007 at 04:44:39PM +0200, Matthias Saou wrote:
>> single square brackets, I thought "[" was a symlink to the
>> coreutils "test" command, [..]
>
>AFAIK, it used to be hard link, not symlink.
>
>> -rwxr-xr-x 1 root root 32168 Apr 17 13:48 /usr/bin/[
>> -rwxr-xr-x 1 root root 29544 Apr 17 13:48 /usr/bin/test
>
>GNU Coding Standards now declare that the behaviour of binary
>should not depend on its name.
-- 
____________________________________________________________________
TonyN.:'                       <mailto:tonynelson@xxxxxxxxxxxxxxxxx>
      '                              <http://www.georgeanelson.com/>


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux