From: Josef Sipek Date: Tue, 06 Mar 2007 07:38:21 GMT Subject: Re: [PATCH 1/1] Guilt: Fixed guilt-patchbomb temporary mbox deletion bug Message-ID: <20070306073821.GA26626@filer.fsl.cs.sunysb.edu> In-Reply-To: <7vvehesvf1.fsf@assigned-by-dhcp.cox.net> On Mon, Mar 05, 2007 at 11:06:26PM -0800, Junio C Hamano wrote: > Nur Hussein writes: > > > echo -n "Delete temporary directory? [Y/n] " > > read n > > > > -[ "$n" != "n" -a "$n" != "N" ] && exit 0 > > +[ "$n" != "n" -o "$n" != "N" ] && exit 0 > > rm -rf $dir > > Is it just me who finds this much more readable? > > case "$n" in [nN]*) exit 0 ;; esac I don't know. I never saw case being "abused" as the condition in a while loop either. I guess it is really a matter of taste. For anything more complex then [nN] I'd go with the case statement as well. I hear that the whole while-case is just an optimization for sh of many moons ago - something about case being builtin but test not. Josef "Jeff" Sipek. -- Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. - Albert Einstein