{"id":209443,"date":"2021-01-23T08:33:58","date_gmt":"2021-01-23T00:33:58","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=209443"},"modified":"2021-01-18T10:36:35","modified_gmt":"2021-01-18T02:36:35","slug":"linux-export-use","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/linux-export-use.html","title":{"rendered":"\u5b66\u4e60\u5982\u4f55\u5728Linux\u4e2d\u4f7f\u7528export\u547d\u4ee4"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u5728\u672c\u6307\u5357\u4e2d\uff0c\u6211\u4eec\u5c06\u5efa\u8bae\u65b0\u624b\u5982\u4f55\u5728Linux\u4e2d\u4f7f\u7528export\u3002Linux export\u547d\u4ee4\u4f1a\u6807\u8bb0\u54ea\u4e9b\u503c\u9700\u8981\u4f20\u9012\u7ed9\u4e00\u7ec4\u5b50\u8fdb\u7a0b\u3002\u8fd9\u662fbash shell\u63d0\u4f9b\u7684\u4e00\u4e2a\u7b80\u5355\u4f46\u6709\u7528\u7684\u7279\u6027\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\"\"<\/a><\/p>\n

Linux export\u547d\u4ee4\u4f1a\u6807\u8bb0\u54ea\u4e9b\u503c\u9700\u8981\u4f20\u9012\u7ed9\u4e00\u7ec4\u5b50\u8fdb\u7a0b\u3002\u8fd9\u662fbash shell\u63d0\u4f9b\u7684\u4e00\u4e2a\u7b80\u5355\u4f46\u6709\u7528\u7684\u7279\u6027\u3002\u5b83\u5141\u8bb8\u7ba1\u7406\u5458\u5728\u4e0d\u4e2d\u65ad\u5f53\u524d\u4f1a\u8bdd\u7684\u60c5\u51b5\u4e0b\u4f20\u9012\u73af\u5883\u7684\u914d\u7f6e\u53c2\u6570\u3002\u8fd9\u5c31\u662f\u4e3a\u4ec0\u4e48\u5728\u7ec8\u7aef\u4f1a\u8bdd\u91cd\u65b0\u542f\u52a8\u540e\u624d\u4f7f\u7528\u5bfc\u51fa\u53d8\u91cf\u7684\u539f\u56e0\u3002\u5e78\u8fd0\u7684\u662f\uff0cexport\u547d\u4ee4\u4f7f\u7528\u8d77\u6765\u975e\u5e38\u7b80\u5355\uff0c\u6613\u4e8e\u638c\u63e1\u3002\u5728\u672c\u6307\u5357\u4e2d\uff0c\u6211\u4eec\u5c06\u5efa\u8bae\u65b0\u624b\u5982\u4f55\u5728Linux\u4e2d\u4f7f\u7528export\u3002<\/p>\n

<\/p>\n

\u5982\u4f55\u4f7f\u7528Linux\u7684export\u547d\u4ee4<\/strong><\/div>\n

<\/strong><\/p>\n

\u60a8\u53ef\u4ee5\u4ee5\u591a\u79cd\u65b9\u5f0f\u4f7f\u7528export\u3002\u4e00\u4e2a\u5e38\u89c1\u7684\u4f8b\u5b50\u662f\u4f7f\u7528export\u6765\u8bbe\u7f6e\u7528\u6237\u73af\u5883\u3002\u7528\u6237\u53ef\u4ee5\u7b80\u5355\u5730\u4f7f\u7528export\u6307\u5b9a\u53d8\u91cf\u5e76\u5c06\u5b83\u4eec\u6dfb\u52a0\u5230\u4ed6\u4eec\u7684.profile\u6587\u4ef6\u4e2d\u3002\u56e0\u6b64\uff0c\u6bcf\u6b21\u7528\u6237\u767b\u5f55\u65f6\uff0c\u73af\u5883\u90fd\u5c06\u6309\u7167\u8fd9\u79cd\u65b9\u5f0f\u914d\u7f6e\u3002<\/strong><\/p>\n

<\/p>\n

1\u3001\u663e\u793aexport\u6240\u6709\u7684\u53d8\u91cf<\/strong><\/span><\/div>\n

<\/strong><\/p>\n

\u5f53\u4e0d\u5e26\u4efb\u4f55\u53c2\u6570\u4f7f\u7528\u65f6\uff0cexport\u547d\u4ee4\u5c06\u663e\u793a\u73af\u5883\u4e2d\u6240\u6709export\u53d8\u91cf\u7684\u5217\u8868\u3002\u60a8\u5e94\u8be5\u80fd\u591f\u67e5\u770b\u53d8\u91cf\u7684\u540d\u79f0\u53ca\u5176\u5bf9\u5e94\u7684\u503c\u3002<\/p>\n

linuxmi@linuxmi:~$\u00a0export\r\n<\/pre>\n

\u901a\u8fc7\u4f7f\u7528Linux grep\u547d\u4ee4\u548cexport\u547d\u4ee4\uff0c\u53ef\u4ee5\u5f88\u5bb9\u6613\u5730\u627e\u5230\u5173\u4e8e\u7279\u5b9a\u53d8\u91cf\u7684\u4fe1\u606f\u3002\u4e0b\u9762\u7684\u547d\u4ee4\u4f7f\u7528\u4e00\u4e2a\u7b80\u5355\u7684\u4f8b\u5b50\u6765\u8bf4\u660e\u8fd9\u4e00\u70b9\u3002<\/p>\n

linuxmi@linuxmi:~$\u00a0export\u00a0LINUXMI<\/span>=\"Welcome\u00a0to\u00a0linuxmi.com\"<\/span>\r\nlinuxmi@linuxmi:~$\u00a0export\u00a0|\u00a0grep\u00a0-i\u00a0linuxmi\r\n<\/pre>\n
2\u3001\u663e\u793a\u5f53\u524dShell\u7684export\u53d8\u91cf<\/strong><\/strong><\/span><\/div>\n

export\u7684-p\u6807\u5fd7\u5c06\u6253\u5370\u51fa\u5f53\u524dLinux shell\u4e2d\u6240\u6709\u5bfc\u51fa\u53d8\u91cf\u7684\u5217\u8868\u3002\u770b\u770b\u4e0b\u9762\u7684\u4f8b\u5b50\uff0c\u770b\u770b\u8fd9\u662f\u4ec0\u4e48\u610f\u601d\u3002<\/p>\n

linuxmi@linuxmi:~$\u00a0export\u00a0-p\r\n<\/pre>\n

\u60a8\u53ef\u4ee5\u4f7f\u7528\u8fd9\u4e2a\u547d\u4ee4\u6765\u6392\u9664\u6b63\u5728\u8fd0\u884c\u7684shell\u4f1a\u8bdd\u7684\u5404\u79cd\u914d\u7f6e\u95ee\u9898\u3002<\/p>\n

3\u3001Linux\u4e0b\u7684export\u53d8\u91cf<\/strong><\/strong><\/span><\/div>\n

export\u547d\u4ee4\u4f7f\u8de8\u73af\u5883\u5171\u4eab\u53d8\u91cf\u53d8\u5f97\u5f88\u5bb9\u6613\u3002\u60a8\u53ef\u4ee5\u4f7f\u7528export\u8bed\u53e5\u8bbe\u7f6e\u53d8\u91cf\u7684\u503c\u3002\u4e0b\u9762\u7684\u793a\u4f8b\u6f14\u793a\u4e86\u8fd9\u4e00\u70b9\u3002<\/p>\n

linuxmi@linuxmi:~$\u00a0export\u00a0EDITOR<\/span>=\/usr\/bin\/gedit\r\n<\/pre>\n

\u8fd9\u5c06\u628agedit\u7684\u8def\u5f84\u8bbe\u7f6e\u4e3a\u7f16\u8f91\u5668\u53d8\u91cf\u7684\u503c\u3002\u60a8\u53ef\u4ee5\u4f7f\u7528grep\u6765\u786e\u8ba4\u8fd9\u4e00\u70b9\u3002<\/p>\n

linuxmi@linuxmi:~$\u00a0export\u00a0|\u00a0grep\u00a0-i\u00a0EDITOR\r\n<\/pre>\n
4\u3001Linux\u4e0b\u7684\u5bfc\u51fa\u51fd\u6570<\/strong><\/strong><\/span><\/div>\n

\u5f00\u53d1\u4eba\u5458\u53ef\u4ee5\u4f7f\u7528-f\u9009\u9879\u5bfc\u51fa\u51fd\u6570\u3002\u4e0b\u9762\u7684\u793a\u4f8b\u4f7f\u7528\u7b80\u5355\u7684\u6d4b\u8bd5\u51fd\u6570\u6f14\u793a\u4e86\u8fd9\u4e00\u70b9\u3002\u60a8\u53ef\u4ee5\u4f7f\u7528\u6b64\u65b9\u6cd5\u7f16\u5199\u81ea\u5b9a\u4e49shell\u811a\u672c\u3002<\/p>\n

linuxmi@linuxmi:~$\u00a0test\u00a0()\u00a0{\u00a0echo\u00a0\"Test\u00a0Function\";\u00a0}\r\nlinuxmi@linuxmi:~$\u00a0export\u00a0-f\u00a0test\r\nlinuxmi@linuxmi:~$\u00a0bash\r\nTest\u00a0Function\r\ndircolors:\u00a0\/home\/linuxmi\/.dircolors:\u00a0\u6ca1\u6709\u90a3\u4e2a\u6587\u4ef6\u6216\u76ee\u5f55\r\nlinuxmi@linuxmi:~$\u00a0test\r\nTest\u00a0Function\r\n<\/pre>\n

\u8fd9\u5e94\u8be5\u5728\u7ec8\u7aef\u7a97\u53e3\u4e2d\u663e\u793a\u5b57\u7b26\u4e32\" Test Function \"\u3002bash\u8c03\u7528\u7528\u4e8e\u4e3abash\u6d3e\u751f\u4e00\u4e2a\u5b50\u8fdb\u7a0b\u3002\u5426\u5219\uff0ctest\u51fd\u6570\u5c06\u4e0d\u4f1a\u6253\u5370\u6587\u672c\u3002<\/p>\n

5\u3001\u914d\u7f6e\u73af\u5883\u5c5e\u6027<\/strong><\/strong><\/span><\/div>\n

\u5728Linux\u64cd\u4f5c\u7cfb\u7edf\u4e0b\uff0c\u53ef\u4ee5\u4f7f\u7528export\u547d\u4ee4\u914d\u7f6e\u5404\u79cd\u73af\u5883\u53c2\u6570\u3002\u4f8b\u5982\uff0c\u5982\u679c\u60a8\u5c06\u4e0b\u9762\u8fd9\u4e00\u884c\u6dfb\u52a0\u5230.bashrc\u6587\u4ef6\u4e2d\uff0c\u5b83\u5c06\u5728\u6bcf\u6b21\u7cfb\u7edf\u91cd\u65b0\u542f\u52a8\u65f6\u5c06\u5176\u8bbe\u7f6e\u4e3aSnap\u7684\u8def\u5f84\u3002<\/p>\n

linuxmi@linuxmi:~$\u00a0echo\u00a0export\u00a0PATH<\/span>=\"\/snap\/bin\/lxd:$PATH\"<\/span>\u00a0><\/span>><\/span>\u00a0.bashrc\r\n<\/pre>\n

\u5982\u679c\u60a8\u4e0d\u719f\u6089\u914d\u7f6e\u6587\u4ef6\u5185\u90e8\u7684\u5de5\u4f5c\u65b9\u5f0f\uff0c\u4e5f\u4e0d\u5fc5\u62c5\u5fc3\u3002\u53ea\u9700\u5728\u6587\u4ef6\u672b\u5c3e\u6dfb\u52a0\u81ea\u5b9a\u4e49\u5bfc\u51fa\u5373\u53ef\u3002\u8fd9\u6837\uff0c\u5982\u679c\u4f60\u613f\u610f\uff0c\u4f60\u603b\u662f\u53ef\u4ee5\u627e\u5230\u5e76\u5220\u9664\u5b83\u4eec\u3002<\/p>\n

<\/p>\n

\u603b\u7ed3<\/strong><\/div>\n

<\/strong><\/p>\n

Linux export\u547d\u4ee4\u662f\u914d\u7f6e\u73af\u5883\u53c2\u6570\u7684\u4e00\u4e2a\u6709\u7528\u5de5\u5177\u3002\u6b64\u5916\uff0c\u8fd9\u4e2a\u547d\u4ee4\u975e\u5e38\u5bb9\u6613\u638c\u63e1\uff0c\u56e0\u4e3a\u8fd9\u4e2a\u547d\u4ee4\u53ea\u6709\u51e0\u79cd\u4e0d\u540c\u7684\u9009\u9879\u3002\u6211\u4eec\u6982\u8ff0\u4e86\u4e00\u4e9b\u793a\u4f8b\uff0c\u4ee5\u5e2e\u52a9\u60a8\u66f4\u597d\u5730\u7406\u89e3\u8fd9\u4e2a\u5de5\u5177\u3002\u5e0c\u671b\u4ece\u73b0\u5728\u5f00\u59cb\uff0c\u60a8\u53ef\u4ee5\u5f00\u59cb\u4f7f\u7528export\u6765\u5b9a\u5236\u73af\u5883\u3002\u5982\u679c\u9053\u4f60\u5bf9\u8fd9\u4e2a\u7b80\u5355\u7684\u6307\u5357\u6709\u4ec0\u4e48\u770b\u6cd5\u3002\u8bf7\u5728\u8bc4\u8bba\u90e8\u5206\u7ed9\u6211\u4eec\u7559\u8a00\uff0c\u8c22\u8c22\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

Linux export\u547d\u4ee4\u4f1a\u6807\u8bb0\u54ea\u4e9b\u503c\u9700\u8981\u4f20\u9012\u7ed9\u4e00\u7ec4\u5b50\u8fdb\u7a0b\u3002\u8fd9\u662fbash shell\u63d0\u4f9b\u7684\u4e00\u4e2a\u7b80\u5355\u4f46\u6709\u7528\u7684\u7279 […]<\/p>\n","protected":false},"author":643,"featured_media":209446,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-209443","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/209443","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/643"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=209443"}],"version-history":[{"count":4,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/209443\/revisions"}],"predecessor-version":[{"id":209466,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/209443\/revisions\/209466"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/209446"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=209443"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=209443"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=209443"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}