help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: reset a trap upon use


From: bill-auger
Subject: Re: reset a trap upon use
Date: Fri, 24 Nov 2023 12:07:24 -0500

great explanation Koichi - thanks - i did not learn anything about the scoping
or inheritance by reading `info bash trap` or by searching the web - i mainly
just wanted to understand the behavior, verify that the original author of this
code also misunderstood the behavior, or to report a bug if it was behaving
unexpectedly


On Fri, 24 Nov 2023 11:25:05 -0500 Greg wrote:
> Did you actually need anything more than a cleanup-on-exit function?

yes, (at least semantically, and for tidiness) it should cleanup immediately
upon return from setup() normally, and also in case the program exits
abnormally - setup() creates and loopback mounts an OS image file to partition
and populate it - later, the program calls another script which boots the image
with QEMU - the boot script is intended to be run independently on an image
created by the first script, and so it has similar loop mount and unmount
functions - i could perhaps make it work as you are suggesting (by forking i
suppose); but that would be messy magic spaghetti - ive spent too much time
debugging this already - id prefer to have the image cleanly unmounted and
de-looped before calling the boot script, as it expects when run manually



reply via email to

[Prev in Thread] Current Thread [Next in Thread]