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

Re: In scripts use /bin/sh -e or set -e?



  >Bastian Kleineidam <calvin@net.uni-sb.de> wrote:
  >
  >> I noticed that a lot of postinst and other install scripts use
  >> /bin/sh -e, but the -e option is nowhere documented in the man page.

...
OPTIONS
       In  addition  to  the single-character shell options docu­
       mented in the description of the set builtin command, bash
       interprets the following options when it is invoked:
...
       set [--abefhkmnptuvxBCHP] [-o option] [arg ...]
...
              -e      Exit  immediately  if a simple command (see
                      SHELL GRAMMAR above) exits with a  non-zero
                      status.   The  shell  does  not exit if the
                      command that fails is part of an  until  or
                      while  loop,  part of an if statement, part
                      of a && or || list,  or  if  the  command's
                      return value is being inverted via !.

-- 
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight                              http://www.lfix.co.uk/oliver
PGP: 1024R/32B8FAA1: 97 EA 1D 47 72 3F 28 47  6B 7E 39 CC 56 E4 C1 47
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
                 ========================================
     "For I say, through the grace given unto me, to every 
      man that is among you: Do not think of yourself more 
      highly than you ought, but rather think of yourself 
      with sober judgement, in accordance with the measure 
      of faith God has given you."            Romans 12:3 




Reply to: