Chet Ramey wrote:
> Pádraig Brady wrote:
>> -------- Original Message --------
>> Date: Tue, 07 Oct 2008 11:55:51 +0100
>> From: Pádraig Brady <P@draigBrady.com>
>> To: Chet Ramey <chet.ramey@case.edu>
>> CC: thockin@hockin.org
>>
>> I was just discussing bit shifting with Tim Hockin using shell
>> arithmetic expansion, and he pointed out that bash and ksh
>> use arithmetic rather than logical shift for the >> operator.
>
> Actually, bash and ksh use whatever the native C compiler implements,
> since both just translate the >> and << into the same operators
> internally.
>
> I don't see a really compelling reason to change, since, as you say,
> the standard requires signed long ints.
Well that means the result is compiler dependent.
So scripts could give different results on another
platform, or less often within a platform.
Also arithmetic right shift is not useful.
Pádraig.