2013-10-31から1日間の記事一覧

trap コマンドで status code をとることはできないぽい。

また、status code は trap する前の status code になるらしい。 $ cat test.sh trap "echo \"exit code: $?\" " EXIT fuga $ ./test.sh ./test.sh: line 3: fuga: command not found exit code: 0 $ echo $? 127 $また、trap で実行するコマンドでエラーが…