On 10/9/14, 8:20 AM, Andreas Grünbacher wrote: > Hi all, > > the errexit option can be very useful in simple scripts. This option > is being ignored in many contexts like lists and conditionals though. > I understand that this is "by design" and that errexit cannot be > "fixed" to behave more reasonably. Still, this makes bash a lot less > useful than it could be; working around this limitation is painful, > ugly, and leads to fragile code. > > So, since we cannot "fix" errexit, can we maybe introduce another > option like "errfail" that behaves like errexit for simple commands, > but is also logically composable? Let me show what I mean with the > following pseudo-code:
What does logically composable mean in this context? Maybe it would be better if you described how you would like the behavior to differ from errexit. Like Angel, I see that you want errfail to be `inherited' by functions, like errexit; inhibited in the same set of exceptions; but that command substitution failures will cause the shell to exit. Is that accurate? Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, ITS, CWRU c...@case.edu http://cnswww.cns.cwru.edu/~chet/