{"url":"https://anmino.hatenadiary.org/entry/20090808/1249699664","categories":["UNIX/Linux"],"blog_url":"https://anmino.hatenadiary.org/","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fanmino.hatenadiary.org%2Fentry%2F20090808%2F1249699664\" title=\"bash - getopts\u30b3\u30de\u30f3\u30c9 - \u3042\u3093\u307f\u306e\u306e\u5099\u5fd8\u9332\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","title":"bash - getopts\u30b3\u30de\u30f3\u30c9","image_url":null,"width":"100%","blog_title":"\u3042\u3093\u307f\u306e\u306e\u5099\u5fd8\u9332","author_url":"https://blog.hatena.ne.jp/anmino/","author_name":"anmino","provider_url":"https://hatena.blog","description":"\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u89e3\u6790\u3057\u305f\u308a\u30c1\u30a7\u30c3\u30af\u3059\u308b\u305f\u3081\u306e\u30b3\u30de\u30f3\u30c9\u3002 command [-f] [-v value] \u3068\u3044\u3046\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8\u304c\u3042\u308b\u3068\u3057\u307e\u3059\u3002 FLAG=FALSE #f\u30aa\u30d7\u30b7\u30e7\u30f3\u304c\u6307\u5b9a\u3055\u308c\u305f\u304b\u306e\u30d5\u30e9\u30b0 VALUE= #v\u30aa\u30d7\u30b7\u30e7\u30f3\u306e\u5f15\u6570\u3092\u4ee3\u5165\u3059\u308b OPT= #getopts\u304c\u4f7f\u7528\u3059\u308b\u3001\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u9806\u756a\u306b\u4ee3\u5165\u3059\u308b while getopts fv: OPT #fv\u306f\u4f7f\u7528\u3059\u308b\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4e26\u3079\u305f\u3082\u306e\u3001:\u306f\u5f15\u6570\u3092\u5fc5\u8981\u3068\u3059\u308b\u3082\u306e do #OPT\u306b\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u9806\u756a\u306b\u4ee3\u5165\u3057\u3066\u3044\u304f case $OPT in f) FLAG=TRUE ;; v) VALUE=$OPTARG #OPTARG\u306fge\u2026","height":"190","type":"rich","provider_name":"Hatena Blog","version":"1.0","published":"2009-08-08 11:47:44"}