reassign 276964 dash
retitle 276964 set -e; if eval ...; then ...; else ...; fi exits if false,
rather than executing 'else'
severity 276964 critical
severity 268944 critical
forwarded 276964 upstream
merge 268944 276964
submitter 276964 !
thanks
On Tue, Feb 22, 2005 at 01:43:17AM +0100, Jeroen van Wolffelaar wrote:
> | elif ! eval $mysqlcmd -f $dbname -e "\"$statement\"" >/dev/null 2>&1 ; then
> | log="${log}Executing command to mysql."
> | (...)
> | else
> | status=nothing
> | fi
>
> This should, even though set -e is enabled, NOT result in abortion of shell
> execution.
Ok, this is a dash bug, #268944.
Because /bin/sh claims to be a replacement /bin/sh when installing, this
is IMHO a critical bug -- it breaks unrelated software.
Either dash should not advertise itself as a replacement /bin/sh, or it
should behave like one expects from a /bin/sh, exiting when evaluating
an 'if' condition being not something someone expects from a /bin/sh shell.
Thanks,
--Jeroen
--
Jeroen van Wolffelaar
[EMAIL PROTECTED]
http://jeroen.A-Eskwadraat.nl
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]