<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>oinume</author_name>
  <author_url>https://blog.hatena.ne.jp/oinume/</author_url>
  <blog_title>oinume journal</blog_title>
  <blog_url>https://oinume.hatenablog.com/</blog_url>
  <categories>
    <anon>Shell</anon>
  </categories>
  <description>#!/bin/sh DIR=$1 rm -rf $DIR/ なんてやると$1がなかった時に / が消されてしまうので非常に危険。こういう場合は set -u して、未定義の変数があればエラーにすることが推奨される。 /Users/kazuhiro/Dropbox/code/sh/set_u.sh: line 3: $1: unbound variable ただし、 set -u すると引数の個数を$#を使って、いちいちチェックしないといけない。 #!/bin/sh set -u # 引数のサイズをチェック if [ $# -le 1 ]; then exit 1 fi DIR=$1 rm -r…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Foinume.hatenablog.com%2Fentry%2Fwp%2F455&quot; title=&quot;Shellでset -uした時の引数の取り扱い - oinume journal&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>2012-04-07 22:04:10</published>
  <title>Shellでset -uした時の引数の取り扱い</title>
  <type>rich</type>
  <url>https://oinume.hatenablog.com/entry/wp/455</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
