Stupid bash question

Mikkel L. Ellertson mikkel at infinity-ltd.com
Mon Dec 10 23:31:39 UTC 2007


aragonx at dcsnow.com wrote:
> Okay, I'm confused.  How would bash interpret this line?
> 
> [ "`isthislinux`" = "LINUX" ] && ulimit -S -n 65536
> 
> Would that be teh same as:
> 
> if [ "`isthislinux`" == "LINUX" ]
> then
>    ulimit -S -n 65536
> fi
> 
> This is quite confusing to me.
> 
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.

You may want to read the bash man page. It covers the [ command, as
well as how && and || are processed by  the shell.

Mikkel
-- 

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: OpenPGP digital signature
Url : http://lists.fedoraproject.org/pipermail/users/attachments/20071210/55fdffb7/attachment-0001.bin 


More information about the users mailing list