Re: [PATCH] Supplant the "while case ... break ;; esac" idiom
- From
David Symonds <dsymonds@gmail.com>
- Date
- Sep 24, 2007, 06:30 UTC
- Message-ID
- <ee77f5c20709232330n7b47d9e9v38677678dbf197da@mail.gmail.com>
- In-Reply-To
- <85k5qgk295.fsf@lola.goethe.zz>
On 24/09/2007, David Kastrup <dak@gnu.org> wrote:
Show 9 quoted lines
> Mike Hommey <mh@glandium.org> writes: > > > On Sun, Sep 23, 2007 at 10:42:08PM +0200, David Kastrup wrote: > >> -while case $# in 0) break ;; esac > >> +while test $# != 0 > > > > Wouldn't -ne be better ? > > Why?
Because -ne does a numeric comparison, != does a string comparison, and it's a numeric comparison happening, semantically speaking.
Dave.