Marc Herbert <Marc.Herbert@gmail.com> writes:
>> let intentionally returns status 1 if the value was 0; and status > 1 if
>> there was an error. Why? So you can do loops such as:
>>
>> countdown=10
>> while let countdown--; do ... ; done
>>
>>> Why does this happen? Is it 'by design'?
>>
>> Yes. The same as for 'expr' which is standardized by POSIX to have the
>> same behavior.
>
> This is a design mistake: it trades a few characters for a lot of confusion.
You can always choose to ignore the exit status. The converse is not
true.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."