{"blog_url":"https://oinume.hatenablog.com/","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Foinume.hatenablog.com%2Fentry%2Fwp%2F455\" title=\"Shell\u3067set -u\u3057\u305f\u6642\u306e\u5f15\u6570\u306e\u53d6\u308a\u6271\u3044 - oinume journal\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","url":"https://oinume.hatenablog.com/entry/wp/455","author_url":"https://blog.hatena.ne.jp/oinume/","published":"2012-04-07 22:04:10","blog_title":"oinume journal","image_url":null,"categories":["Shell"],"author_name":"oinume","type":"rich","width":"100%","height":"190","provider_url":"https://hatena.blog","title":"Shell\u3067set -u\u3057\u305f\u6642\u306e\u5f15\u6570\u306e\u53d6\u308a\u6271\u3044","provider_name":"Hatena Blog","version":"1.0","description":"#!/bin/sh DIR=$1 rm -rf $DIR/ \u306a\u3093\u3066\u3084\u308b\u3068$1\u304c\u306a\u304b\u3063\u305f\u6642\u306b / \u304c\u6d88\u3055\u308c\u3066\u3057\u307e\u3046\u306e\u3067\u975e\u5e38\u306b\u5371\u967a\u3002\u3053\u3046\u3044\u3046\u5834\u5408\u306f set -u \u3057\u3066\u3001\u672a\u5b9a\u7fa9\u306e\u5909\u6570\u304c\u3042\u308c\u3070\u30a8\u30e9\u30fc\u306b\u3059\u308b\u3053\u3068\u304c\u63a8\u5968\u3055\u308c\u308b\u3002 /Users/kazuhiro/Dropbox/code/sh/set_u.sh: line 3: $1: unbound variable \u305f\u3060\u3057\u3001 set -u \u3059\u308b\u3068\u5f15\u6570\u306e\u500b\u6570\u3092$#\u3092\u4f7f\u3063\u3066\u3001\u3044\u3061\u3044\u3061\u30c1\u30a7\u30c3\u30af\u3057\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u3002 #!/bin/sh set -u # \u5f15\u6570\u306e\u30b5\u30a4\u30ba\u3092\u30c1\u30a7\u30c3\u30af if [ $# -le 1 ]; then exit 1 fi DIR=$1 rm -r\u2026"}