On Tue, 17 Jul 2007 16:35:03 +0200, "Paul de Weerd" <[EMAIL PROTECTED]>
said:
> On Tue, Jul 17, 2007 at 03:27:51PM +0100, Stuart Henderson wrote:
> | > My manpage (ksh(1)) says :
> | > 
> | >      [[ expression ]]
> | >              Similar to the test and [ ... ] commands (described
> later), with
> | >              the following exceptions:
> | > 
> | > And then lists some exceptions. This could be a difference between sh
> | > and ksh (which, I believe, is only a difference in documentation).
> | 
> | It does different things depending on whether it's run as ksh or sh.
> 
> As far as my quick test (not definitive by any means) shows, it does
> not do anything different with respect to handling [[ ]].
> 
> The description of [[ ]] is missing from sh(1) though, hence my
> statement "which, I believe, is only a difference in documentation".

[[ is not listed in sh(1) because this construct doesn't exist in sh(1).
There is a difference in the [[ construct in ksh. Read man ksh(1).
Most significantly;
o   Field splitting and file name generation are not per-
     formed on arguments.
o   The second operand of the `!=' and `=' expressions are
     patterns (e.g. the comparison [[ foobar = f*r ]] suc-
     ceeds).

Reply via email to