25 Haziran 2026 Perşembe tarihinde Léa Gris <[email protected]> yazdı:
> Le 25/06/2026 à 00:36, Gregory Heytings écrivait :
>
>> Is this better than
>>
>> trap_append () { trap "$(printf "%s\n$1" "$(trap -P "$2")")" "$2"; }
>> trap_prepend () { trap "$(printf "$1\n%s" "$(trap -P "$2")")" "$2"; }
>>
>
> While effective, these functions rely on subshells for serialization and
> re-parsing, introducing unnecessary overhead and reduced readability due to
> the density required for quoting and string manipulation.
>
I believe you can avoid subshells using no-fork command substitutions here.
But I recall there was a feature request on this list for a `defer'
command, so maybe there's an audience for this... Anyway, thanks for
sharing it with us
--
Oğuz