Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Sep 2006 11:09:42 -0500
From:      Derek Ragona <derek@computinginnovations.com>
To:        Arindam <arindam.mukerjee@gmail.com>, freebsd-questions@freebsd.org
Subject:   Re: Korn Shell [[ ... ]] operator
Message-ID:  <6.0.0.22.2.20060925110339.021a7c68@mail.computinginnovations.com>
In-Reply-To: <d85a51ff0609250831x76b9ff15j7c1c2d3e62976802@mail.gmail.co m>
References:  <d85a51ff0609250831x76b9ff15j7c1c2d3e62976802@mail.gmail.com>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
The [[ ]] operators are for compound tests, the [ ] operator is for simple 
tests.  In ksh newer than 6/3/86 the [[ ]] makes the [ ] obsolete.


Example of [[ ]]:
[[ foo > bar && $PWD -ef . ]] && print foobar
foobar


That is from the kornshell book co-written by David Korn.

By the way, I use ksh for my root's shell and it works fine.

         -Derek


At 10:31 AM 9/25/2006, Arindam wrote:
>I know csh is the shell of choice on FreeBSD. But I have this question
>on Korn Shell and it would be great if somebody could explain.
>
>Can someone tell me a little more about the Korn Shell [[ ... ]]
>double-brackets construct used for comparing string expressions. How
>does it differe from the standard [ ... ] single brackets.
>
>You could tell me to RTFM but I haven't gleaned enough clarity from
>such efforts already expended.
>
>It would be great if you could give some idea through examples.
>
>Cheers,
>Andy
>--
>_______________________________________________
>freebsd-questions@freebsd.org mailing list
>http://lists.freebsd.org/mailman/listinfo/freebsd-questions
>To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"
>
>--
>This message has been scanned for viruses and
>dangerous content by MailScanner, and is
>believed to be clean.
>MailScanner thanks transtec Computers for their support.
>

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
MailScanner thanks transtec Computers for their support.




Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?6.0.0.22.2.20060925110339.021a7c68>