tech-userlevel archive

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

/bin/sh: set -e is broken again



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.


Home | Main Index | Thread Index | Old Index