Re: Help with first bash script please

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

 



Serge de Souza wrote:
Paul Howarth wrote:
I also find it useful to think of the "[" in the "if" statement:

if [ x = y ]; then ...

as being the same as the command "test" (see man test). When you think of it ("[") as a command (which it is), the need for a space after it is more obvious in my mind.

Paul.

So much so that '[' is a sym link to test:

ls -l /usr/bin/[
lrwxrwxrwx  1 root root 4 Mar 13  2004 /usr/bin/[ -> test

Indeed, but both [ and test are builtins in bash so it won't use the ones in /usr/bin unless you specifically tell it to.


Paul.


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

  Powered by Linux