Re: [PATCH] Allow shell scripts to run with non-Bash /bin/sh
- From
David Kastrup <dak@gnu.org>
- Date
- Sep 22, 2007, 11:07 UTC
- Message-ID
- <85ps0buffr.fsf@lola.goethe.zz>
- In-Reply-To
- <7vd4wbgp9t.fsf@gitster.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 30 quoted lines
> David Kastrup <dak@gnu.org> writes: > >> Eygene Ryabinkin <rea-git@codelabs.ru> writes: >> >>>> That is, what does the shell say if you do this? >>>> >>>> case Ultra in >>>> Super) >>>> false ;; >>>> Hyper) >>>> true ;; >>>> esac && >>>> echo case returned ok >>> >>> It says 'case returned ok', so I will try to understand why it >>> works here and does not work in the 'while' construct. >> >> What you actually need to do is >> >> false >> case Ultra in >> Super) >> false ;; >> Hyper) >> true ;; >> esac && echo case returned ok > > AHHHHHH. > > Is "case" supposed to be transparent?
Not that I would know. It is basically a revival of the
false if false then : ; fi || echo "this fails!?!"
bug that probably has been fixed by now. For obvious reasons, conditionals without a taken branch are considered to have an exit code of 0.
-- David Kastrup, Kriemhildstr. 15, 44793 Bochum