Re: Succinct, idiomatic abort in execlineb scripts?

From: Laurent Bercot <ska-skaware_at_skarnet.org>
Date: Tue, 06 Sep 2022 03:21:59 +0000

  As other people said, using "if" instead of "foreground" is the
idiomatic way to exit on child error. I myself am a staunch
"#!/bin/sh -e" user, and almost never use "foreground" in execline
scripts - only when I specifically need the exit code of some command.

  Forwarding signals to a child is only desirable in two cases: when
you're performing job control, and when for some reason you cannot exec
a long-lived process and have to run it as a child.
  execline isn't supposed to be an interactive language so job control
is out of its scope. And to perform signal forwarding on long-lived
children, it provides the "trap" binary.

  Hope this helps,

--
  Laurent
Received on Tue Sep 06 2022 - 05:21:59 CEST

This archive was generated by hypermail 2.4.0 : Tue Sep 06 2022 - 05:22:28 CEST