Re: [PATCH 1/1] Guilt: Fixed guilt-patchbomb temporary mbox deletion bug

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Mar 05, 2007 at 11:06:26PM -0800, Junio C Hamano wrote:
> Nur Hussein <hussein@xxxxxxxxx> 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
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]