On 06/08/2020 14:57, Eli Schwartz wrote:
On 8/6/20 9:15 AM, k...@plushkava.net wrote:
You beat me to it. I was just about to suggest wait $! || exit. Indeed,
I mentioned the same in a recent bug report against wireguard-tools.
So if I understand correctly, you reported the lack of wait $! || exit
in a script, and the script author instead responded by requesting a new
feature in bash that does the same thing, except after a random interval
during another command's execution?
Well, I wouldn't presume to know whether there is any relationship
between said report and the feature request under discussion. Briefly,
the errexit pitfall that affected me can be seen here:
https://github.com/WireGuard/wireguard-tools/blob/v1.0.20200513/src/wg-quick/darwin.bash#L299
I happened to mention that the exit status value of networksetup(8) is
never checked and that it ought to be, with wait $! being one way of
doing so. That being said, the proposed solution eschewed the use of
process substitution altogether.
I concur. The scripts I looked at tended heavily towards error handling
at a distance and were already subject to one or two amusing errexit
pitfalls.
lol, I bet we could fix that by adding even more error handling at a
distance.
--
Kerin Millar