<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>bearmini</author_name>
  <author_url>https://blog.hatena.ne.jp/bearmini/</author_url>
  <blog_title>bearmini's blog</blog_title>
  <blog_url>https://bearmini.hatenablog.com/</blog_url>
  <categories>
  </categories>
  <description>stackoverflow に答えとともに良い説明があった。 http://stackoverflow.com/a/677212/2122085#!/bin/sh なスクリプトの場合（bash ではなく sh を使っている場合）は \command -v foo &gt;/dev/null 2&gt;&amp;1 || { echo &gt;&amp;2 &quot;'foo' is required. Aborting.&quot;; exit 1; } で OK。こういう場合、よく which を使う（というか僕はいままで which を使っていた）のだけど、それだとどうもコマンドが見つからなかった時に 0（正常終了）を返してくる環境があるら…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fbearmini.hatenablog.com%2Fentry%2F2013%2F09%2F20%2F131003&quot; title=&quot;シェルスクリプトの中でコマンドが存在するかどうかを確かめる方法 - bearmini&amp;#39;s blog&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>2013-09-20 13:10:03</published>
  <title>シェルスクリプトの中でコマンドが存在するかどうかを確かめる方法</title>
  <type>rich</type>
  <url>https://bearmini.hatenablog.com/entry/2013/09/20/131003</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
