On 12/10/10 12:17 PM, Marc Herbert wrote:
> Le 10/12/2010 16:05, Andreas Schwab a écrit :
>>>
>>> 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.
>
> Agreed, but that does not imply any command should try to be creative
> and throw random status values in obscure corner cases just to show off.
That's a little harsh, don't you think? The behavior of let and its
sibling `((', and expr before it, is designed to make this kind of thing
very easy:
while (( x )); do something with x and decrement it ; done
The exit status rules are very simple and well-defined. If you don't
like the way let works, there's nothing stopping you from using `:'
or straight variable assignment together with $((...)).
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU [email protected] http://cnswww.cns.cwru.edu/~chet/