Korn Shell [[ ... ]] operator

Derek Ragona derek at computinginnovations.com
Mon Sep 25 09:10:20 PDT 2006


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 at freebsd.org mailing list
>http://lists.freebsd.org/mailman/listinfo/freebsd-questions
>To unsubscribe, send any mail to "freebsd-questions-unsubscribe at 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.



More information about the freebsd-questions mailing list