{"id":13481,"date":"2023-08-05T08:59:31","date_gmt":"2023-08-04T23:59:31","guid":{"rendered":"https:\/\/lab4ict.com\/system\/?p=13481"},"modified":"2023-08-05T09:30:13","modified_gmt":"2023-08-05T00:30:13","slug":"bash%e3%82%92%e4%bd%bf%e7%94%a8%e3%81%97%e3%81%a6%e3%82%b9%e3%82%af%e3%83%aa%e3%83%97%e3%83%88%e3%82%92%e4%bd%9c%e6%88%90%e3%81%99%e3%82%8b%ef%bc%81%ef%bc%88while%e6%96%87%ef%bc%89","status":"publish","type":"post","link":"https:\/\/lab4ict.com\/system\/archives\/13481","title":{"rendered":"Bash\u3092\u4f7f\u7528\u3057\u3066\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u4f5c\u6210\u3059\u308b\uff01\uff08while\u6587\uff09"},"content":{"rendered":"<p>Bash\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u3001while\u6587\u306b\u3088\u308b\u7e70\u308a\u8fd4\u3057\u306e\u30ed\u30b8\u30c3\u30af\u3092\u8a18\u8ff0\u3059\u308b\u65b9\u6cd5\u3067\u3059\u3002<br \/>\n<!--more--><\/p>\n<h2>while\u6587\u306e\u66f8\u5f0f\u3092\u78ba\u8a8d\u3059\u308b\uff01<\/h2>\n<p>for\u6587\u306e\u66f8\u5f0f\u306f\u3001\u4ee5\u4e0b\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nwhle \u7e70\u308a\u8fd4\u3057\u6761\u4ef6 ; do\r\n    #\r\ndone\r\n<\/pre>\n<h2>\u30b5\u30f3\u30d7\u30eb\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u4f5c\u6210\u3059\u308b\uff01<\/h2>\n<p>while\u6587\u3067\u6761\u4ef6\u304cfalse\u306b\u306a\u308b\u307e\u3067\u8fd4\u307e\u3059\u3002\u4ee5\u4e0b\u3001\u30d5\u30a1\u30a4\u30eb\u304b\u3089\u30c7\u30fc\u30bf\u3092\u8aad\u307f\u8fbc\u3093\u3067\u8868\u793a\u3059\u308b\u30b5\u30f3\u30d7\u30eb\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1,17,19]; title: ; notranslate\" title=\"\">\r\n$ cat sample_bash_06.sh \r\n#!\/bin\/bash\r\n#\r\n# Usage   : sample_bash_06.sh $1\r\n# Version : 1.0\r\n#\r\nSHELL_NAME=`basename $0`\r\nSTA_MSG=Start!\r\nEND_MSG=End!\r\n \r\n# START\r\n\/usr\/bin\/logger -ip local0.crit -t ${SHELL_NAME} ${STA_MSG}\r\n  \r\n# Main\r\nDAT_FILE=&quot;filelist.txt&quot;\r\n\r\nwhile read line ; do\r\n    echo ${line}\r\ndone &lt; ${DAT_FILE}\r\n\r\n# END\r\n\/usr\/bin\/logger -ip local0.crit -t ${SHELL_NAME} ${END_MSG}\r\n \r\nexit 0\r\n<\/pre>\n<p>\u8aad\u307f\u8fbc\u3080\u30d5\u30a1\u30a4\u30eb\u306e\u5185\u5bb9\u306f\u3001\u4ee5\u4e0b\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n$ cat filelist.txt\r\nfile1.txt\r\nfile2.txt\r\nfile3.txt\r\n<\/pre>\n<h2>\u30b5\u30f3\u30d7\u30eb\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5b9f\u884c\u3057\u3066\u307f\u308b\uff01<\/h2>\n<p>\u30b5\u30f3\u30d7\u30eb\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5b9f\u884c\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [1]; title: ; notranslate\" title=\"\">\r\n$ .\/sample_bash_06.sh \r\nfile1.txt\r\nfile2.txt\r\nfile3.txt\r\n<\/pre>\n<h2>\u304a\u308f\u308a\u306b<\/h2>\n<p>while\u6587\u3067\u7e70\u308a\u8fd4\u3057\u306e\u30ed\u30b8\u30c3\u30af\u3092\u8a18\u8ff0\u3057\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<h2>\u95a2\u9023\u8a18\u4e8b<\/h2>\n<div class=\"sc_getpost\"><a class=\"clearfix\" href=\"https:\/\/lab4ict.com\/system\/archives\/8692\" ><div class=\"sc_getpost_thumb post-box-thumbnail__wrap\"><img decoding=\"async\" src=\"data:image\/gif;base64,R0lGODdhAQABAPAAAN3d3QAAACwAAAAAAQABAAACAkQBADs=\" width=\"150\" height=\"150\" alt=\"\u3010\u8a18\u4e8b\u4e00\u89a7\u3011Linux\u3067\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u4f5c\u6210\u3059\u308b\uff01\uff08bash\uff09\" loading=\"lazy\" data-src=\"https:\/\/lab4ict.com\/system\/wp-content\/uploads\/2021\/02\/fi_linux_01-150x150.png\" class=\"lazyload\"><\/div><div class=\"title\">\u3010\u8a18\u4e8b\u4e00\u89a7\u3011Linux\u3067\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u4f5c\u6210\u3059\u308b\uff01\uff08bash\uff09<\/div><div class=\"substr\">Linux\u306ebash\u3067\u3001\u30b7\u30a7\u30eb\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u4f5c\u6210\u3059\u308b\u305f\u3081\u306e\u8a18\u4e8b\u4e00\u89a7\u3067\u3059\u3002...<\/div><\/a><\/div>\n<h2>\u95a2\u9023\u66f8\u7c4d\uff08Amazon\uff09<\/h2>\n<p><iframe sandbox=\"allow-popups allow-scripts allow-modals allow-forms allow-same-origin\" style=\"width:120px;height:240px;\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\" frameborder=\"0\" src=\"\/\/rcm-fe.amazon-adsystem.com\/e\/cm?lt1=_blank&bc1=000000&IS2=1&bg1=FFFFFF&fc1=000000&lc1=0000FF&t=infotecr-22&language=ja_JP&o=9&p=8&l=as4&m=amazon&f=ifr&ref=as_ss_li_til&asins=4774186945&linkId=51dbc0ee6d79ef74ced87300db344bdb\"><\/iframe><\/p>\n<hr \/>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Bash\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u3001while\u6587\u306b\u3088\u308b\u7e70\u308a\u8fd4\u3057\u306e\u30ed\u30b8\u30c3\u30af\u3092\u8a18\u8ff0\u3059\u308b\u65b9\u6cd5\u3067\u3059\u3002<\/p>\n","protected":false},"author":1,"featured_media":5527,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[189],"tags":[374,861,761,680,630,859],"class_list":["post-13481","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-shell-script","tag-bash","tag-while","tag-761","tag-680","tag-630","tag-859"],"_links":{"self":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts\/13481","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/comments?post=13481"}],"version-history":[{"count":5,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts\/13481\/revisions"}],"predecessor-version":[{"id":13486,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/posts\/13481\/revisions\/13486"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/media\/5527"}],"wp:attachment":[{"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/media?parent=13481"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/categories?post=13481"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lab4ict.com\/system\/wp-json\/wp\/v2\/tags?post=13481"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}