{"id":1339,"date":"2018-10-27T15:25:57","date_gmt":"2018-10-27T07:25:57","guid":{"rendered":"http:\/\/www.yusian.com\/blog\/?p=1339"},"modified":"2018-10-27T15:25:57","modified_gmt":"2018-10-27T07:25:57","slug":"%e6%89%a7%e8%a1%8cshell%e8%af%ad%e5%8f%a5%e7%9a%84%e4%b8%89%e7%a7%8d%e5%b8%b8%e7%94%a8%e6%96%b9%e5%bc%8f","status":"publish","type":"post","link":"https:\/\/www.yusian.com\/blog\/macos\/2018\/10\/27\/1525571339.html","title":{"rendered":"\u6267\u884cshell\u8bed\u53e5\u7684\u4e09\u79cd\u5e38\u7528\u65b9\u5f0f"},"content":{"rendered":"<p>1\u3001\u6211\u4eec\u5728\u7ec8\u7aef\u4e2d\u7ecf\u5e38\u9700\u8981\u8f93\u5165\u4e00\u4e9b\u5e38\u7528\u7684\u6307\u4ee4\uff0c\u6709\u65f6\u5019\u8fd8\u662f\u91cd\u590d\u540c\u6837\u7684\u64cd\u4f5c\uff0c\u6bcf\u6b21\u90fd\u6572\u4e00\u904d\uff0c\u9ebb\u70e6\u53c8\u6d6a\u8d39\u65f6\u95f4\uff0c\u6ca1\u6709\u610f\u4e49\uff1b<br \/>\n2\u3001\u8981\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\uff0c\u53ef\u4ee5\u7f16\u5199\u4e00\u4e9b\u7b80\u5355\u7684shell\u811a\u672c\u4fdd\u5b58\u5230\u4e00\u4e2a.sh\u7684\u6587\u4ef6\u4e2d<br \/>\n3\u3001\u6211\u60f3\u8bf4\u7684\u662f\u6267\u884cshell\u811a\u672c\u6709\u4e09\u79cd\u5e38\u7528\u7684\u65b9\u5f0f\uff1a<br \/>\n3.1\u3001sh xxx.sh<br \/>\n\u8fd9\u79cd\u65b9\u5f0f\u6267\u884c\u7ed3\u675f\u540e\uff0c\u5f53\u524d\u4f4d\u7f6e\u6ca1\u6709\u4efb\u4f55\u53d8\u5316\uff0c\u56e0\u4e3a\u811a\u672c\u5728\u5b50\u7ebf\u7a0b\u4e2d\u6267\u884c\uff0c\u5bf9\u5f53\u524d\u4f4d\u7f6e\u65e0\u5f71\u54cd\uff1b<br \/>\n3.2\u3001bash xxx.sh<br \/>\n\u4e0esh xxx.sh\u7c7b\u4f3c<br \/>\n3.3\u3001source xxx.sh<br \/>\n\u8fd9\u4e2a\u4e0e\u4e0a\u8ff0\u4e24\u79cd\u4e0d\u592a\u4e00\u6837\uff0c\u8fd9\u79cd\u65b9\u5f0f\u6267\u884c\u662f\u5728\u5f53\u524d\u7ec8\u7aef\u7684\u5f53\u524d\u7ebf\u7a0b\u4e2d\u6267\u884c\uff0c\u5f71\u54cd\u5f53\u524d\u7684\u4f4d\u7f6e\u6216\u72b6\u6001\uff0c\u6bd4\u5982\u8bf4.sh\u4e2d\u6709cd xxx\u5207\u6362\u76ee\u5f55\u7684\u64cd\u4f5c\uff0c\u90a3\u4e48\u5f53\u524d\u7684\u76ee\u5f55\u4f4d\u7f6e\u4f1a\u88ab\u4fee\u6539\u6389\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1\u3001\u6211\u4eec\u5728\u7ec8\u7aef\u4e2d\u7ecf\u5e38\u9700\u8981\u8f93\u5165\u4e00\u4e9b\u5e38\u7528\u7684\u6307\u4ee4\uff0c\u6709\u65f6\u5019\u8fd8\u662f\u91cd\u590d\u540c\u6837\u7684\u64cd\u4f5c\uff0c\u6bcf\u6b21\u90fd\u6572\u4e00\u904d\uff0c\u9ebb\u70e6\u53c8\u6d6a\u8d39\u65f6\u95f4\uff0c\u6ca1\u6709\u610f\u4e49\uff1b 2\u3001\u8981\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\uff0c\u53ef\u4ee5\u7f16\u5199\u4e00\u4e9b\u7b80\u5355\u7684shell\u811a\u672c\u4fdd\u5b58\u5230\u4e00\u4e2a.sh\u7684\u6587\u4ef6\u4e2d 3\u3001\u6211\u60f3\u8bf4\u7684\u662f\u6267\u884cshell\u811a\u672c\u6709\u4e09\u79cd\u5e38\u7528\u7684\u65b9\u5f0f\uff1a 3.1\u3001sh xxx.sh \u8fd9\u79cd\u65b9\u5f0f\u6267\u884c\u7ed3\u675f\u540e\uff0c\u5f53\u524d\u4f4d\u7f6e\u6ca1\u6709\u4efb\u4f55\u53d8\u5316\uff0c\u56e0\u4e3a\u811a\u672c\u5728\u5b50\u7ebf\u7a0b\u4e2d\u6267\u884c\uff0c\u5bf9\u5f53\u524d\u4f4d\u7f6e\u65e0\u5f71\u54cd\uff1b 3.2\u3001bash xxx.sh \u4e0esh xxx.sh\u7c7b\u4f3c 3.3\u3001source xxx.sh \u8fd9\u4e2a\u4e0e\u4e0a\u8ff0\u4e24\u79cd\u4e0d\u592a\u4e00\u6837\uff0c\u8fd9\u79cd\u65b9\u5f0f\u6267\u884c\u662f\u5728\u5f53\u524d\u7ec8\u7aef\u7684\u5f53\u524d\u7ebf\u7a0b\u4e2d\u6267\u884c\uff0c\u5f71\u54cd\u5f53\u524d\u7684\u4f4d\u7f6e\u6216\u72b6\u6001\uff0c\u6bd4\u5982\u8bf4.sh\u4e2d\u6709cd xxx\u5207\u6362\u76ee\u5f55\u7684\u64cd\u4f5c\uff0c\u90a3\u4e48\u5f53\u524d\u7684\u76ee\u5f55\u4f4d\u7f6e\u4f1a\u88ab\u4fee\u6539\u6389\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21,12,120],"tags":[139,142,141,140],"class_list":["post-1339","post","type-post","status-publish","format-standard","hentry","category-centos","category-macos","category-reverse","tag-shell","tag-142","tag-141","tag-140"],"_links":{"self":[{"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/posts\/1339","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/comments?post=1339"}],"version-history":[{"count":0,"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/posts\/1339\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/media?parent=1339"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/categories?post=1339"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/tags?post=1339"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}