{"categories":["Bash","Shell"],"image_url":null,"version":"1.0","height":"190","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fboscono.hatenablog.com%2Fentry%2F2014%2F05%2F31%2F080245\" title=\"bash\u3067\u4e00\u56de\u3067\u3082\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u305f\u3089\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u30a8\u30e9\u30fc\u7d42\u4e86\u3059\u308b - \u3066\u304d\u3068\u3046\u306a\u30e1\u30e2\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","published":"2014-05-31 08:02:45","author_name":"boscono","type":"rich","url":"https://boscono.hatenablog.com/entry/2014/05/31/080245","provider_url":"https://hatena.blog","provider_name":"Hatena Blog","blog_url":"https://boscono.hatenablog.com/","blog_title":"\u3066\u304d\u3068\u3046\u306a\u30e1\u30e2","author_url":"https://blog.hatena.ne.jp/boscono/","width":"100%","description":"some_command if [ $? -ne 0 ] then echo \"failed to execute some_command\" exit 1 fi \u3068\u304b\u6bce\u56de\u3084\u308b\u306e\u306f\u3081\u3093\u3069\u3044\u306e\u3067\u3001 err_handler() { echo \"failed to execute '$BASH_COMMAND'\" exit 1 } trap err_handler ERR some_command ... \u3068\u3084\u308c\u3070\u3044\u3044\u304btrap\u306f\u30b7\u30b0\u30ca\u30eb\u3092\u30c8\u30e9\u30c3\u30d7\u3059\u308b\u30d3\u30eb\u30c8\u30a4\u30f3\u30b3\u30de\u30f3\u30c9\u3067\u3001ERR\u306f\u901a\u5e38\u306e\u30b7\u30b0\u30ca\u30eb\u3067\u306f\u306a\u304f\u64ec\u4f3c\u30b7\u30b0\u30ca\u30eb\u3002man bash\u306b\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u66f8\u3044\u3066\u3042\u308b\u3002 If a sigspec is ERR\u2026","title":"bash\u3067\u4e00\u56de\u3067\u3082\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u305f\u3089\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u30a8\u30e9\u30fc\u7d42\u4e86\u3059\u308b"}