Revision: elho-tools--main--0--patch-55 Archive: elho@elho.net--elho-debian Creator: Elmar Hoffmann Date: Sat Nov 21 18:27:49 CET 2020 Standard-date: 2020-11-21 17:27:49 GMT Modified-files: shell-tools New-patches: elho@elho.net--elho-debian/elho-tools--main--0--patch-55 Summary: workaround $(trap) being executed in a subshell Keywords: While POSIX mandates as a special case that shells do not execute $(trap) in a subshell, some (e.g. dash) unfortunately violate this, thus renderng the typical var=$(trap) idiom useless due to always evaluating to an empty result. This implements a workaround using a temporary file for the trap output that is removed ASAP while in use to minimize the chance of it being left around in case of error or interruption.