tech-toolchain archive

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

Re: set -e (was: parallel build failure with .c.o rule interrupted mid-step!)



    Date:        Thu, 6 Mar 2025 11:34:29 +0100
    From:        Edgar =?iso-8859-1?B?RnXf?= <ef%math.uni-bonn.de@localhost>
    Message-ID:  <Z8l6NUHxJcfbPnv1%trav.math.uni-bonn.de@localhost>

  | I find it quite useful outside of make (in cases I either forget adding 
  | || errror "blah" in some places or it's too clumsy).

If your code is very boring (just a list of commands to run) then
it would work as expected (except I find I need to add "||:" at the
end of every command where failure is irrelevant (like echo/printf etc).

But if the code has anything more complex (functions, conditionals, ...)
even many shell experts can't easily tell what -e will, or won't do.
It really isn't wise to rely upon it, just write the code to test for
errors when that is needed.

People who don't get the results they expect when using -e contribute
one of the more common complaints about just about any shell.

kre



Home | Main Index | Thread Index | Old Index