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.
That still mostly work but maybe, e.g. the code need to check if
grep returned 2 (aka error) while 1 isn't an error but just didn't
match anything.
--
ionen
-----BEGIN PGP SIGNATURE-----
iQEzBAABCAAdFiEEx3SLh1HBoPy/yLVYskQGsLCsQzQFAmJanxgACgkQskQGsLCs QzT3uggAwOA/QmHckvghwMvoiBXcPk4ISsLD2YWhXIpHANNoUCCEOe0K7JzrPOzF rFZHoIVSo2rtSvTktbf0/rYgVu0ZDGxjZrH9L+CRKv+OAZvv9n66usa+UKHga8l1 3lLGLdvMx7CjFVi+RkZ5WToUa9UXEZBdIL8tVR4ZGmKe9iaEPmaBAx+Gi8RKjNj6 Ky/WX7semGC0kGyj26bqx+CJU+4CpeWIm3xgufR+gU/Sb4fpUycEkHvhfh5BvL5g RxIGz0NPtNWKcPBpg8Z9Koy68D/pW7LtuT6vM0oVSGnUZ2/o90j05swON6BINthc mL2QocU7iQ0GWICqlaNLhyTSLsxT2g==
=2JNM
-----END PGP SIGNATURE-----
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)