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

Re: Add "nice -10" to /etc/crontab run-parts commands?

On Tue, Jun 01, 1999 at 04:33:24PM +0200, Detlev Zundel wrote:
> Tommi Virtanen <tv@debian.org> writes:
> > > onacpow && run_heavy_job
> > 
> >         The later will crash & burn if any script uses set -e 
> >         (which is usually encouraged).
> > 
> >         if onacpow; then run_heavy_job; fi
> Hm? Am I missing something here? Excerpt from the bash(1) man-page:
>        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 !.
> So bash doesn't crash or burn - is this behaviour limited to bash?

        false && echo foo will always cause bash to exit.
        If there is something else in the script, it will not be
        executed, even if the onacpow test would only _seem_ to
        apply to that one line. This is in this case unintended 

        Fortunately the original usage suggestion was for a
        one-line crontab invokation, where
        1) -e is not in effect
        2) there is no "rest of the script"

        End of thread?
Havoc Consulting | unix, linux, perl, mail, www, internet, security consulting
+358 50 5486010  | software development, unix administration, training

Reply to: