Bob Proulx <bob@proulx.com> writes:
> Peng Yu wrote:
>> I looks a little wired why 'until' is the way it is now.
>> ...
>> until test-commands; do consequent-commands; done
>> while ! test-commands; do consequent-commands; done
>
> In the original Bourne shell there is no '!' operator. The 'until'
> was a way to negate the expression without using a '!' which didn't
> exist in that shell. An 'if' could operate using the 'else' clause.
> But there wasn't any other way to do it in a while loop.
You could always do
while test-commands; test $? -ne 0; do ...; done
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."