<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>coffee_kabu</author_name>
  <author_url>https://blog.hatena.ne.jp/coffee_kabu/</author_url>
  <blog_title>Bus errorとSegmentation faultに困ったら見るブログ</blog_title>
  <blog_url>https://coffee-guhaw.hateblo.jp/</blog_url>
  <categories>
    <anon>シェルコマンド/シェルスクリプト</anon>
  </categories>
  <description>まず終了ステータスについて■ 参考 : exitコマンド（シェルを終了する)シェルスクリプトの最後にexit [n]と書いた場合はnが終了コード nを書かない場合は最後に実行したコマンドの終了コードを引き継いで正常終了する nに数字以外を書くとエラー終了nは0から255の数字を入れる 1のみエラー終了、それ以外は正常終了 ■ 参考 : 終了ステータスを設定 終了ステータスは $? というシェル変数に代入されているので、その値を見て処理を分岐させればOK ただし、そんな処理分岐をしなくても command1が成功したら、command2を実行するという風に処理を進めたい場合は次のように書けばOK…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fcoffee-guhaw.hateblo.jp%2Fentry%2F2025%2F09%2F19%2F000000&quot; title=&quot;【シェルスクリプト】終了ステータスとset -e - Bus errorとSegmentation faultに困ったら見るブログ&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2025-09-19 00:00:00</published>
  <title>【シェルスクリプト】終了ステータスとset -e</title>
  <type>rich</type>
  <url>https://coffee-guhaw.hateblo.jp/entry/2025/09/19/000000</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
