Re: [PATCH] Supplant the "while case ... break ;; esac" idiom
- From
David Kastrup <dak@gnu.org>
- Date
- Sep 24, 2007, 13:58 UTC
- Message-ID
- <86k5qgtbag.fsf@lola.quinscape.zz>
- In-Reply-To
- <87k5qgrxcu.fsf@catnip.gol.com>
Miles Bader <miles@gnu.org> writes:
Show 12 quoted lines
> Eygene Ryabinkin <rea-git@codelabs.ru> writes: >>> The comment "... holds only for a shell where [ is a builtin" doesn't >>> make any sense to me >> >> The 'while case ...' construct does not invoke any external commands. >> The 'while test ...' too, but only when 'test' is builtin. When >> 'test' is the external binary you get one additional fork/exec per >> each cycle. > > In practice that's not an issue though -- every reasonable shell has > test as a builtin these days, so the "works when test is not a builtin" > criteria is really important only for robustness.
Since the external test is pretty standardized, "works when test is one of various builtins" is actually more important for robustness...
-- David Kastrup