From: Felipe Contreras Date: Thu, 13 May 2021 06:10:18 GMT Subject: Re: [PATCH 4/8] doc: simplify the handling of interruptions Message-ID: <609cc2ca7cf26_1e7820868@natae.notmuch> In-Reply-To: Junio C Hamano wrote: > Felipe Contreras writes: > > > +"${args[@]}" -o "$out" "$1" || > > +{ rm -f "$out"; false; } > > It would be so nice if this worked, but here is what I saw in a > quick-and-dirty experiment: > > $ f hoi || rm hoi ;# wait a bit and hit ^C > > So, I suspect it unfortunately may not work well. That's because the interrupt signal is not caught. This works: sh -c 'echo foo >"$1" && trap "exit 1" INT && sleep 20' test hoi || rm hoi And so does this: #!/bin/sh ruby - hoi < We need to get 2/8 redone without bash-ism, Yes, if we agree this approach is indeed desirable I can do that. Cheers. -- Felipe Contreras