Current-Users archive

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

Re: sh -e changes broke pkgsrc



> This seems to boil down to a documentation issue.
Another bug in that spec.
Subsentence of
http://www.opengroup.org/onlinepubs/000095399/utilities/set.html

   -e When this option is on, if a simple command fails for any of the
   reasons listed in Consequences of Shell Errors or returns an exit
   status value >0, and is not a pipeline preceded by the ! reserved
   word, then the shell shall immediately exit.

simple_command is NOT a pipeline BY DEFINITION.

I'll try to make a resume for the tests from the original PR (as originator).

1) IMHO it makes sense to process && and || just like most other shells do.
   (though I personally whould like to see "exit if compound command fails"
   logic :-( )

   That is
     'true && false' should exit
     'false && anything' should NOT exit
     'false || false' should exit

2) 'anything | false' should exit just like most shells do

   '! true' should exit just like most shells do

   '! anything | true' should exit just like most shells do

3)       true | false &
         job=$!
         wait $job

  should exit

-- 
Best regards, Aleksey Cheusov.


Home | Main Index | Thread Index | Old Index