On Sat, Apr 16, 2022 at 06:48:56AM -0400, Ionen Wolkens wrote:
> On Sat, Apr 16, 2022 at 12:23:18PM +0200, Florian Schmaus wrote:
> > >      ebegin "Running $@"
> > >      "$@"
> > >      eend $? || die -n "$@ failed" >      return $?
> > 
> > I think this return statement can be omitted since it will always be 
> > invoked with 0 as argument, and this is the default behavior of implicit 
> > function return (IIRC).
> 
> Not with nonfatal (die is using -n to allow it)
> 
> nonfatal edo false || echo "different error handling: $?"
> 
> Without return $?, the above will echo 0 or 1 if die was triggered
> but (with current implementation) won't be the actual return code.

Err wait, return $? won't help with that, need a temporary variable
to preserve.

return $? indeed does nothing here :)

-- 
ionen

Attachment: signature.asc
Description: PGP signature

Reply via email to