Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

/bin/sh: set -e is broken again

2 views
Skip to first unread message

Aleksey Cheusov

unread,
Jul 31, 2011, 6:29:40 AM7/31/11
to
The following commit introduced serious regression
in shell's 'set -e' since 5.1

bin/sh/eval.c
----------------------------
revision 1.99
date: 2010/06/03 16:06:48; author: christos; state: Exp; lines: +3 -3
set -e is supposed to work inside eval; skip EV_TESTED.

Try to run this code

#!/bin/sh

set -e
if eval false; then
echo 'Impossible!'
else
echo 'Ok'
fi

Current's shell unexpectedly exits at 'if' statement.

FreeBSD's fix for the same problem is here.

http://www.freebsd.org/cgi/query-pr.cgi?pr=134881

I didn't try it.

--
Best regards, Aleksey Cheusov.

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-...@muc.de

0 new messages