[Top][All Lists]

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

Re: simple bug/compat question

From: Chet Ramey
Subject: Re: simple bug/compat question
Date: Fri, 23 Jan 2009 11:56:16 -0500
User-agent: Thunderbird (Macintosh/20081209)

Linda Walsh wrote:
>> It's not a bug.
> ---
>     It's a feature... ;-)
>>   test/[ uses -a and -o for `and' and `or'; the
>> conditional command uses && and || for that purpose.  This is
>> they way it's documented.
> ---
> Would it be inappropriate if "[[" were to treat "-a" && "-o" identically
> to "&&" -a "||" so "[[" could be more of a drop-in replacement for
> "/bin/[" ?

I don't think this would be a good idea.  [[ doesn't parse && and ||
the same way [ parses -a and -o -- the two are not the same.

Frankly, I'd like to see test expressions rewritten to use the shell
|| and && operators rather than changing [[.


``The lyf so short, the craft so long to lerne.'' - Chaucer

Chet Ramey, ITS, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/

reply via email to

[Prev in Thread] Current Thread [Next in Thread]