Date: Mon, 8 Aug 2022 15:16:41 -0400 From: "Robert E. Griffith" <b...@junga.com> Message-ID: <887ca26e-1c9e-f500-1bd9-6d339ab5a...@junga.com>
| I think a better solution to that would have been to leave return alone | and instead allow the trap to access the $? value of the last command | before the interruption in the first command of the trap string similar | to how the ERROR trap works. (or in a new special var if that is | problematic for some reason). There's no need for anything to make that work, when the trap action starts running $? is set to whatever it was just previously, and the code there can save and/or use that value however it sees the need. The issue (really the only issue related to $?) should be what value it has when the trap action ceases running. While it is running we just have sh code, which should execute identically to what it would were it not in a trap action. kre