{"id":373,"date":"2020-07-28T00:04:59","date_gmt":"2020-07-27T15:04:59","guid":{"rendered":"https:\/\/0x0c.info\/?p=373"},"modified":"2020-07-28T00:04:59","modified_gmt":"2020-07-27T15:04:59","slug":"%e3%80%90bash%e3%80%91-%e3%83%87%e3%82%a3%e3%83%ac%e3%82%af%e3%83%88%e3%83%aa%e4%b8%8b%e3%81%ae%e5%85%a8rar%e3%83%95%e3%82%a1%e3%82%a4%e3%83%ab%e3%82%92zip%e3%81%ab%e5%a4%89%e6%8f%9b%e3%81%99%e3%82%8b","status":"publish","type":"post","link":"https:\/\/0x0c.info\/?p=373","title":{"rendered":"\u3010bash\u3011 \u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u4e0b\u306e\u5168rar\u30d5\u30a1\u30a4\u30eb\u3092zip\u306b\u5909\u63db\u3059\u308b"},"content":{"rendered":"<p>\t\t\t\t\u5909\u63db\u3059\u308b\u3001\u3068\u3044\u3046\u304b\u5c55\u958b\u3057\u3066\u3001zip\u306b\u56fa\u3081\u76f4\u3057\u307e\u3059\u3002<\/p>\n<pre><code>#!\/bin\/sh\n\nfor dir in *.rar;\ndo\n    echo $dir\n    bn=\"${dir%.*}\"\n    echo $bn\n    mkdir \"${bn}\"\n    cd \"${bn}\"\n    unrar e \"..\/${dir}\"\n    cd ..\n    zip -r \"${bn}\".zip .\/\"${bn}\"\/\ndone\n<\/code><\/pre>\n<p>\u5c55\u958b\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u306f\u6d88\u3057\u3066\u307e\u305b\u3093\u3002<br \/>\nunrar\u3068\u304bzip\u3068\u304b\u306f\u5148\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002\t\t<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5909\u63db\u3059\u308b\u3001\u3068\u3044\u3046\u304b\u5c55\u958b\u3057\u3066\u3001zip\u306b\u56fa\u3081\u76f4\u3057\u307e\u3059\u3002 #!\/bin\/sh for dir in *.rar; do echo $dir bn=&#8221;${dir%.*}&#8221; echo $bn mkdir &#8220;${bn}&#8221; cd &#8220;${bn}&#8221; unrar e &#8220;..\/${dir}&#8221; cd .. zip -r &#8220;${bn}&#8221;.zip .\/&#8221;${bn}&#8221;\/ done \u5c55\u958b\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u306f\u6d88\u3057\u3066\u307e\u305b\u3093\u3002 unrar\u3068\u304bzip\u3068\u304b\u306f\u5148\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[16,66,86],"class_list":["post-373","post","type-post","status-publish","format-standard","hentry","category-linux","tag-bash","tag-rar","tag-zip"],"_links":{"self":[{"href":"https:\/\/0x0c.info\/index.php?rest_route=\/wp\/v2\/posts\/373","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/0x0c.info\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/0x0c.info\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/0x0c.info\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/0x0c.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=373"}],"version-history":[{"count":0,"href":"https:\/\/0x0c.info\/index.php?rest_route=\/wp\/v2\/posts\/373\/revisions"}],"wp:attachment":[{"href":"https:\/\/0x0c.info\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=373"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/0x0c.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=373"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/0x0c.info\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=373"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}