Environment variable inheritance in ERR trap handlers
When using the trap builtin with the ERR signal to manage script failures during upgrades, recovery logic often depends on the exit status of the preceding command. To ensure a safe rollback, the handler must inspect the $? variable to determine which specific operation triggered the failure. There is uncertainty regarding the precise execution context of th