|
| From: | Gioele Barabucci |
| Subject: | Re: Debian bug #929178: wrong trap displayed inside functions |
| Date: | Mon, 25 Mar 2024 17:18:11 +0100 |
| User-agent: | Mozilla Thunderbird |
On 25/03/24 17:12, Oğuz wrote:
On Monday, March 25, 2024, Gioele Barabucci <gioele@svario.it
<mailto:gioele@svario.it>> wrote:
If a function does not set a trap, `trap` will output the command
set by the caller. This is just a cosmetic issue, the right trap
will be run at runtime.
Doesn't POSIX allow this? How else do you propose we save the trap set
for an event into a variable if `x=$(trap)' stops working?
Just for reference, neither dash nor busybox sh preserve the caller's trap:
trap in f1:
f1 output: <>
trap in f2 (initial):
trap in f2 (final):
f2 output: <f2>
main
Regards,
--
Gioele Barabucci
| [Prev in Thread] | Current Thread | [Next in Thread] |