{"id":2350,"date":"2019-05-27T00:04:38","date_gmt":"2019-05-26T16:04:38","guid":{"rendered":"https:\/\/www.linuxcool.com\/?p=2350"},"modified":"2022-06-17T15:59:41","modified_gmt":"2022-06-17T07:59:41","slug":"export","status":"publish","type":"post","link":"https:\/\/www.linuxcool.com\/export","title":{"rendered":"export\u547d\u4ee4 – \u5c06\u53d8\u91cf\u63d0\u5347\u6210\u73af\u5883\u53d8\u91cf"},"content":{"rendered":"\n

export\u547d\u4ee4\u7684\u529f\u80fd\u662f\u7528\u4e8e\u5c06\u53d8\u91cf\u63d0\u5347\u6210\u73af\u5883\u53d8\u91cf\uff0c\u4ea6\u53ef\u5c06Shell\u51fd\u6570\u8f93\u51fa\u4e3a\u73af\u5883\u53d8\u91cf\u3002\u901a\u5e38\u4e2a\u4eba\u521b\u5efa\u51fa\u7684\u53d8\u91cf\u4ec5\u80fd\u5728\u81ea\u5df1\u8d26\u6237\u4e0b\u4f7f\u7528\uff0c\u5176\u4ed6\u4eba\u662f\u65e0\u6cd5\u770b\u5230\u7684\uff0c\u82e5\u60f3\u8ba9\u6bcf\u4e2a\u4eba\u90fd\u80fd\u770b\u5230\u5e76\u6709\u6743\u5229\u53bb\u4f7f\u7528\u53d8\u91cf\u503c\u7684\u8bdd\uff0c\u5219\u9700\u8981\u4f7f\u7528export\u547d\u4ee4\u8fdb\u884c\u63d0\u5347\u64cd\u4f5c\u3002<\/p>\n\n\n\n

\u8bed\u6cd5\u683c\u5f0f\uff1a<\/strong> export [\u53c2\u6570] [\u53d8\u91cf]<\/p>\n\n\n\n

\u5e38\u7528\u53c2\u6570\uff1a<\/strong><\/p>\n\n\n\n

-f <\/td>\u6307\u5b9a\u51fd\u6570\u540d\u79f0<\/td><\/tr>
-n<\/td>\u5220\u9664\u6307\u5b9a\u7684\u53d8\u91cf<\/td><\/tr>
-p <\/td>\u5217\u51fa\u6240\u6709\u7684\u73af\u5883\u53d8\u91cf<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n

\u53c2\u8003\u5b9e\u4f8b<\/strong><\/p>\n\n\n\n

\u5217\u51fa\u5f53\u524d\u7cfb\u7edf\u4e2d\u6240\u6709\u7684\u73af\u5883\u53d8\u91cf\u4fe1\u606f\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# export -p<\/strong>\r\ndeclare -x COLORTERM=\"truecolor\"\r\ndeclare -x DBUS_SESSION_BUS_ADDRESS=\"unix:path=\/run\/user\/0\/bus\"\r\ndeclare -x DESKTOP_SESSION=\"gnome\"\r\ndeclare -x DISPLAY=\":0\"\r\ndeclare -x GDMSESSION=\"gnome\"\r\n\u2026\u2026\u2026\u2026\u2026\u2026\u7701\u7565\u90e8\u5206\u8f93\u51fa\u4fe1\u606f\u2026\u2026\u2026\u2026\u2026\u2026<\/pre>\n\n\n\n

\u5c06\u6307\u5b9a\u53d8\u91cf\u63d0\u5347\u6210\u73af\u5883\u53d8\u91cf\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# export MYENV <\/strong><\/pre>\n\n\n\n

\u5b9a\u4e49\u4e00\u4e2a\u53d8\u91cf\u5e76\u63d0\u5347\u6210\u73af\u5883\u53d8\u91cf\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# export MYENV=linuxcool.com<\/strong><\/pre>\n","protected":false},"excerpt":{"rendered":"

export\u547d\u4ee4\u7684\u529f\u80fd\u662f\u7528\u4e8e\u5c06\u53d8\u91cf\u63d0\u5347\u6210\u73af\u5883\u53d8\u91cf\uff0c\u4ea6\u53ef\u5c06Shell\u51fd\u6570\u8f93\u51fa\u4e3a\u73af\u5883\u53d8\u91cf\u3002\u901a\u5e38\u4e2a\u4eba\u521b\u5efa\u51fa\u7684\u53d8\u91cf\u4ec5\u80fd […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/2350"}],"collection":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/comments?post=2350"}],"version-history":[{"count":14,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/2350\/revisions"}],"predecessor-version":[{"id":10328,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/2350\/revisions\/10328"}],"wp:attachment":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/media?parent=2350"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/categories?post=2350"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/tags?post=2350"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}