Follow

trapってhandler置き換えちゃうのかー。
goのdefer風味に使いたいんだけどナー。

$ sh -x test.sh
+ trap 'echo handler 1' EXIT
+ trap 'echo handler 2' EXIT
+ echo hello
hello
+ echo handler 2
handler 2

Sign in to participate in the conversation
Mastodon

Experimental private instance. Running on FreeBSD!