Robert Millan [ackstorm] wrote:

>>>     There's bitwise AND and bitwise OR, and logical AND and logical OR, but
>>>     for XOR there's only the bitwise version.  Would be nice if the logical
>>>     XOR would also be present (^^).
>> (!a) != (!b)
>>
>> should work acceptably for the situations such an operator would be used.
> 
> I'm not sure what you mean.  The following:
> 
>       (true && ! false) || (false && ! true)
>       echo $?
> 
> works, whereas the following:
> 
>       (! true) != (! false)
>       echo $?
> 
> shows syntax error.

That really doesn't have anything to do with the issue.  The original
question concerned the arithmetic operators accepted by the expression
evaluator, not the shell language.

>> The reason it's not there is because it's not in C.
> 
> Because of performance?

Because bash implements a subset of C's arithmetic language (with one
exception), and C doesn't have a logical XOR operator.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                       Live Strong.  No day but today.
Chet Ramey, ITS, CWRU    [EMAIL PROTECTED]    http://cnswww.cns.cwru.edu/~chet/


_______________________________________________
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash

Reply via email to