Re: Stupid bash question

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

 



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 ;-)
> 
> <Joe
> 
I do too. The last time I had checked there were the same command. I
guess I should have double checked before posting. It looks like
test was changed so you do not need the [ ]. You can use something
like "test $DISPLAY && echo DISPLAY is set." but not
"[ $DISPLAY && echo DISPLAY is set." or even [ $DISPLAY ] && echo
DISPLAY is set.". I guess the test man page needs to be updated, and
maybe a man page added for [.

Mikkel
-- 

  Do not meddle in the affairs of dragons,
for thou art crunchy and taste good with Ketchup!

Attachment: signature.asc
Description: OpenPGP digital signature

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux