﻿{"id":4592,"date":"2020-12-10T10:34:01","date_gmt":"2020-12-10T02:34:01","guid":{"rendered":"https:\/\/www.linuxmi.com\/?p=4592"},"modified":"2020-12-10T10:34:01","modified_gmt":"2020-12-10T02:34:01","slug":"shell-zhushi","status":"publish","type":"post","link":"https:\/\/www.linuxmi.com\/shell-zhushi.html","title":{"rendered":"shell\u4e2d\u5982\u4f55\u8fdb\u884c\u4e00\u6bb5\u4ee3\u7801\u7684\u6ce8\u91ca"},"content":{"rendered":"<p>\u5728shell\u7f16\u7a0b\u4e2d\uff0c\u6211\u4eec\u5e38\u5e38\u9700\u8981\u628a\u4e00\u4e9b\u8bed\u53e5\u6ce8\u91ca\u6389\uff0c\u8ba9\u5b83\u4e0d\u6267\u884c\uff0c\u5bf9\u5355\u53f7\u6216\u8005\u5c11\u6570\u51e0\u884cshell\u811a\u672c\u6765\u8bf4\uff0c\u5728\u6bcf\u884c\u524d\u9762\u589e\u52a0#\u7b26\u53f7\u5c31\u53ef\u4ee5\u8fbe\u5230\u76ee\u7684\u4e86\uff0c\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<p>#cp .\/a.txt .\/b.txt<br \/>\n#mkdir -p {1,2,4}\/{2,4,6}<br \/>\n#echo &#8220;ok&#8221;<\/p>\n<p>\u4f46\u5982\u679c\u6211\u4eec\u9700\u8981\u5bf9\u4e00\u5927\u6bb5\u7684shell\u811a\u672c\u8fdb\u884c\u6ce8\u91ca\uff0c\u5018\u82e5\u6211\u4eec\u90fd\u5728\u6bcf\u884c\u524d\u9762\u6dfb\u52a0#\uff0c\u8fd9\u5bf9\u6211\u4eec\u6765\u8bf4\uff0c\u786e\u5b9e\u4e0d\u662f\u4e00\u4ef6\u5f88\u4ee4\u4eba\u8212\u670d\u7684\u4e8b\u60c5\uff0c\u90a3\u4e48\uff0c\u5728shell\u4e2d\uff0c\u6709\u6ca1\u529e\u6cd5\u91c7\u7528\u7c7b\u4f3cc\u8bed\u8a00\u7684\u6ce8\u91ca\/* &#8230;*\/\u6765\u8fbe\u5230\u4e00\u6574\u6bb5\u7684\u6ce8\u91ca\u6548\u679c\u5462\uff1f\u7b14\u8bb0\u7ecf\u8fc7\u6d4b\u8bd5\uff0c\u53d1\u73b0\u4e0b\u9762\u7684\u65b9\u6cd5\u662fok\u7684\u3002<\/p>\n<p>:&lt;&lt;!EOF! #\u6b64\u53e5\u524d\u8fb9\u7684\uff1a\u53ef\u6709\u53ef\u65e0<br \/>\ncp .\/a.txt .\/b.txt<br \/>\nmkdir -p {1,2,3}\/{4,5,6}<br \/>\necho &#8220;ok&#8221;<br \/>\n!EOF!<\/p>\n<p>\u751a\u81f3\u53ef\u4ee5\u628a\u8981\u6ce8\u91ca\u7684shell\u6574\u4f53\u53d8\u6210\u4e00\u4e2a\u51fd\u6570\u6765\u8fbe\u5230\u4e0d\u8ba9\u6267\u884c\u7684\u76ee\u7684\u3002<\/p>\n<p>notExce(){<br \/>\ncp .\/a.txt .\/b.txt<br \/>\nmkdir -p {1,2,3}\/{4,5,6}<br \/>\necho &#8220;ok&#8221;<br \/>\n}<\/p>\n<p><strong>\u811a\u672c\u6ce8\u91ca#\uff0c\u591a\u884c\u6ce8\u91ca\u6dfb\u52a0\u592a\u9ebb\u70e6\u4e86\u3002<\/strong><\/p>\n<p>\u91c7\u7528\u5f62\u5f0f\uff1a<\/p>\n<p>\uff1a&lt;&lt;Linux<br \/>\n\u7b2c\u4e00\u884c<br \/>\n\u7b2c\u4e8c\u884c<br \/>\n&#8230;<br \/>\nLinux<\/p>\n<p>\u524d\u540e\u4e24\u4e2aLinux\u4e5f\u53ef\u4ee5\u66ff\u6362\u6210\u4efb\u610f\u5728\u88ab\u6ce8\u91ca\u4ee3\u7801\u884c\u4e2d\u672a\u51fa\u73b0\u8fc7\u7684\u5b57\u7b26\u4e32\u3002<\/p>\n<p>\u6ce8\u610f\uff1a\u7b2c\u4e8c\u4e2aLinux\u9700\u8981\u9876\u683c\u5199\uff0c\u524d\u9762\u4e0d\u80fd\u6709\u7a7a\u683c\u3002<\/p>\n<p><strong>shell\u4e2d\u6ce8\u91ca\u4e00\u6bb5\u4ee3\u7801\u7684\u65b9\u6cd5<\/strong><\/p>\n<p>if false; then<br \/>\ncode<br \/>\ncode<br \/>\nfi<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728shell\u7f16\u7a0b\u4e2d\uff0c\u6211\u4eec\u5e38\u5e38\u9700\u8981\u628a\u4e00\u4e9b\u8bed\u53e5\u6ce8\u91ca\u6389\uff0c\u8ba9\u5b83\u4e0d\u6267\u884c\uff0c\u5bf9\u5355\u53f7\u6216\u8005\u5c11\u6570\u51e0\u884cshell\u811a\u672c\u6765\u8bf4\uff0c &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[3],"tags":[154],"class_list":["post-4592","post","type-post","status-publish","format-standard","hentry","category-linux","tag-shell"],"aioseo_notices":[],"views":1373,"_links":{"self":[{"href":"https:\/\/www.linuxmi.com\/wp-json\/wp\/v2\/posts\/4592","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.linuxmi.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxmi.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxmi.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxmi.com\/wp-json\/wp\/v2\/comments?post=4592"}],"version-history":[{"count":1,"href":"https:\/\/www.linuxmi.com\/wp-json\/wp\/v2\/posts\/4592\/revisions"}],"predecessor-version":[{"id":4593,"href":"https:\/\/www.linuxmi.com\/wp-json\/wp\/v2\/posts\/4592\/revisions\/4593"}],"wp:attachment":[{"href":"https:\/\/www.linuxmi.com\/wp-json\/wp\/v2\/media?parent=4592"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxmi.com\/wp-json\/wp\/v2\/categories?post=4592"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxmi.com\/wp-json\/wp\/v2\/tags?post=4592"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}