{"id":3123,"date":"2012-06-09T10:58:58","date_gmt":"2012-06-09T02:58:58","guid":{"rendered":"http:\/\/jpuyy.com\/?p=3123"},"modified":"2012-09-25T20:43:33","modified_gmt":"2012-09-25T12:43:33","slug":"shell-variable","status":"publish","type":"post","link":"https:\/\/jpuyy.com\/?p=3123","title":{"rendered":"Shell\u4e2d\u7684\u4e09\u79cd\u53d8\u91cf"},"content":{"rendered":"<p>\u7cfb\u7edf\u53d8\u91cf\uff0c\u73af\u5883\u53d8\u91cf\uff0c\u7528\u6237\u53d8\u91cf<\/p>\n<p>\u5176\u4e2d\u7528\u6237\u53d8\u91cf\u5728\u7f16\u7a0b\u8fc7\u7a0b\u4e2d\u4f7f\u7528\u6700\u591a\uff0c\u7cfb\u7edf\u53d8\u91cf\u5728\u5bf9\u53c2\u6570\u5224\u65ad\u548c\u547d\u4ee4\u8fd4\u56de\u503c\u5224\u65ad\u4f1a\u4f7f\u7528\uff0c\u73af\u5883\u53d8\u91cf\u4e3b\u8981\u662f\u5728\u7a0b\u5e8f\u8fd0\u884c\u7684\u65f6\u5019\u9700\u8981\u8bbe\u7f6e<\/p>\n<p>1 \u7cfb\u7edf\u53d8\u91cf<\/p>\n<p>Shell\u5e38\u7528\u7684\u7cfb\u7edf\u53d8\u91cf\u5e76\u4e0d\u591a\uff0c\u4f46\u5374\u5341\u5206\u6709\u7528\uff0c\u7279\u522b\u662f\u5728\u505a\u4e00\u4e9b\u53c2\u6570\u68c0\u6d4b\u7684\u65f6\u5019\u3002\u4e0b\u9762\u662fShell\u5e38\u7528\u7684\u7cfb\u7edf\u53d8\u91cf<\/p>\n<table border=\"0\" cellspacing=\"1\" cellpadding=\"1\">\n<tbody>\n<tr>\n<th bgcolor=\"#dadada\"><a title=\"Sort by this column\" href=\"http:\/\/www.stlchina.org\/twiki\/bin\/view.pl\/Main\/SSVariableIntro?sortcol=0;table=1;up=0#sorted_table\" rel=\"nofollow\"><span style=\"color: #0066cc;\">\u8868\u793a\u65b9\u6cd5<\/span><\/a><\/th>\n<th align=\"middle\" bgcolor=\"#dadada\"><a title=\"Sort by this column\" href=\"http:\/\/www.stlchina.org\/twiki\/bin\/view.pl\/Main\/SSVariableIntro?sortcol=1;table=1;up=0#sorted_table\" rel=\"nofollow\"><span style=\"color: #0066cc;\">\u63cf\u8ff0<\/span><\/a><\/th>\n<\/tr>\n<tr>\n<td bgcolor=\"#ffffff\">$n<\/td>\n<td bgcolor=\"#ffffff\">$1 \u8868\u793a\u7b2c\u4e00\u4e2a\u53c2\u6570\uff0c$2 \u8868\u793a\u7b2c\u4e8c\u4e2a\u53c2\u6570 &#8230;<\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#eaeaea\">$#<\/td>\n<td bgcolor=\"#eaeaea\">\u547d\u4ee4\u884c\u53c2\u6570\u7684\u4e2a\u6570<\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#ffffff\">$0<\/td>\n<td bgcolor=\"#ffffff\">\u5f53\u524d\u7a0b\u5e8f\u7684\u540d\u79f0<\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#eaeaea\">$?<\/td>\n<td bgcolor=\"#eaeaea\">\u524d\u4e00\u4e2a\u547d\u4ee4\u6216\u51fd\u6570\u7684\u8fd4\u56de\u7801<\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#ffffff\">$*<\/td>\n<td bgcolor=\"#ffffff\">\u4ee5&#8221;\u53c2\u65701 \u53c2\u65702 &#8230; &#8221; \u5f62\u5f0f\u4fdd\u5b58\u6240\u6709\u53c2\u6570<\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#eaeaea\">$@<\/td>\n<td bgcolor=\"#eaeaea\">\u4ee5&#8221;\u53c2\u65701&#8243; &#8220;\u53c2\u65702&#8221; &#8230; \u5f62\u5f0f\u4fdd\u5b58\u6240\u6709\u53c2\u6570<\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#ffffff\">$$<\/td>\n<td bgcolor=\"#ffffff\">\u672c\u7a0b\u5e8f\u7684(\u8fdb\u7a0bID\u53f7)PID<\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#eaeaea\">$!<\/td>\n<td bgcolor=\"#eaeaea\">\u4e0a\u4e00\u4e2a\u547d\u4ee4\u7684PID<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>2 Shell\u7528\u6237\u53d8\u91cf<br \/>\n2.1 \u57fa\u7840<\/p>\n<p>\u4e0d\u7ba1\u7cfb\u7edf\u53d8\u91cf\u6709\u591a\u5c11\uff0c\u5bf9\u4e8e\u9700\u6c42\u6765\u8bf4\uff0c\u603b\u662f\u4e0d\u591f\u7684\u3002\u7528\u6237\u53d8\u91cf\u662f\u6700\u5e38\u7528\u5230\u7684\u53d8\u91cf\uff0c\u4f7f\u7528\u4e5f\u5341\u5206\u7b80\u5355\u3002<br \/>\n\u7528\u6237\u5b9a\u4e49\u7684\u53d8\u91cf\u5fc5\u987b\u7531\u5b57\u6bcd\u6570\u5b57\u53ca\u4e0b\u5212\u7ebf\u7ec4\u6210,\u5e76\u4e14\u53d8\u91cf\u540d\u7684\u7b2c\u4e00\u4e2a\u5b57\u7b26\u4e0d\u80fd\u4e3a\u6570\u5b57, \u4e0e\u5176\u5b83UNIX\u540d\u5b57\u4e00\u6837,\u53d8\u91cf\u540d\u662f\u5927\u5c0f\u5199\u654f\u611f\u7684. \u5bf9\u4e8e\u7528\u6237\u53d8\u91cf,\u7528\u6237\u53ef\u6309\u5982\u4e0b\u65b9\u5f0f\u8d4b\u503c: BeautifierPlugin Error: Unable to handle &#8220;bash&#8221; syntax.<\/p>\n<p>name=&#8221;Winter&#8221;<br \/>\n\u5728\u5f15\u7528\u53d8\u91cf\u65f6,\u9700\u5728\u524d\u9762\u52a0$\u7b26\u53f7\uff0c\u7528\u6237\u4e5f\u53ef\u4ee5\u5728\u53d8\u91cf\u95f4\u8fdb\u884c\u76f8\u4e92\u8d4b\u503c,\u5982: BeautifierPlugin Error: Unable to handle &#8220;bash&#8221; syntax.<br \/>\nname=&#8221;Winter&#8221;<br \/>\nWINTER=$name<br \/>\necho &#8220;Hello $WINTER !&#8221;<br \/>\n\u8f93\u51fa\u7ed3\u679c\u5e94\u8be5\u5f88\u6e05\u695a\uff1aHello Winter !<br \/>\n\u8fd9\u91cc\u9700\u8981\u6ce8\u610f\u4e00\u70b9\uff1a\u53d8\u91cf\u548c\u2018=\u2018\u4e4b\u95f4\u4e0d\u8981\u6709\u7a7a\u683c\uff0c\u2018=\u2018\u548c\u8d4b\u503c\u4e5f\u4e0d\u8981\u6709\u7a7a\u683c\uff0c\u5426\u5219shell\u4e0d\u4f1a\u8ba4\u4e3a\u53d8\u91cf\u88ab\u5b9a\u4e49\u3002\u638c\u63e1\u4e86\u57fa\u672c\u7684\u4f7f\u7528\u65b9\u6cd5\uff0c\u4f60\u53ef\u4ee5\u5b8c\u5168\u5f00\u59cb\u4f60\u7684\u7f16\u7a0b\u5de5\u4f5c\u4e86\u3002\u4e0d\u8fc7\u6709\u65f6\u5019\u9700\u8981\u672a\u96e8\u7ef8\u7f2a\uff0c\u4e0b\u9762\u4ecb\u7ecd\u7528\u6237\u53d8\u91cf\u7684\u4e00\u4e9b\u6280\u5de7\u3002<\/p>\n<p>2.2 \u4f7f\u7528\u6280\u5de7<\/p>\n<p>\u4e5f\u53ef\u4ee5\u7528\u53d8\u91cf\u548c\u5176\u4ed6\u5b57\u7b26\u7ec4\u6210\u65b0\u7684\u5b57,\u8fd9\u65f6\u53ef\u80fd\u9700\u8981\u628a\u53d8\u91cf\u7528{}\u62ec\u8d77,\u5982: BeautifierPlugin Error: Unable to handle &#8220;bash&#8221; syntax.<br \/>\nSAT=Satur<br \/>\necho Today is ${SAT}day<br \/>\n\u8f93\u51fa\u7ed3\u679c\u662f\uff1a Today is Saturday<br \/>\n\u6709\u65f6\u5019\u4e3a\u4e86\u907f\u514d\u53d8\u91cf\u540d\u548c\u522b\u7684\u5b57\u7b26\u4ea7\u751f\u6df7\u6dc6\uff0c\u4f60\u6700\u597d\u517b\u6210\u4e60\u60ef\u628a\u53d8\u91cf\u540d\u7528{}\u62ec\u8d77\u6765\u3002<\/p>\n<p>\u5bf9\u4e8e\u672a\u8d4b\u503c\u7684\u53d8\u91cf, Shell\u4ee5\u7a7a\u503c\u5bf9\u5f85, \u7528\u6237\u4e5f\u53ef\u4ee5\u7528unset\u547d\u4ee4\u6e05\u9664\u7ed9\u53d8\u91cf\u8d4b\u7684\u503c.\u770b\u4e00\u4e2a\u4f8b\u5b50\uff1a BeautifierPlugin Error: Unable to handle &#8220;bash&#8221; syntax.<\/p>\n<p>#!\/bin\/sh<br \/>\necho &#8220;a=$a&#8221; ;<br \/>\na=2<br \/>\necho &#8220;a=$a&#8221; ;<br \/>\nunset a<br \/>\necho &#8220;a=$a&#8221; ;<br \/>\n\u5148\u731c\u731c\u7ed3\u679c\u662f\u4ec0\u4e48\uff1f BeautifierPlugin Error: Unable to handle &#8220;bash&#8221; syntax.<br \/>\n-bash-2.05b$ .\/test.sh<br \/>\na=<br \/>\na=2<br \/>\na=<br \/>\n\u5982\u679c\u4f60\u61c2C++\uff0c\u4f60\u5e94\u8be5\u77e5\u9053\u6709\u4e2a\u53d8\u91cf\u4fee\u9970\u7b26&#8221;const&#8221;\uff0c\u7528\u4e8e\u907f\u514d\u7a0b\u5e8f\u4e00\u4e0d\u5c0f\u5fc3\u5bf9\u53d8\u91cf\u8fdb\u884c\u4fee\u6539\u3002\u5728shell\u4e2d\uff0c\u5bf9\u4e8e\u7528\u6237\u53d8\u91cf\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528\u540c\u6837\u7684\u4fee\u9970\u7b26&#8221;readonly&#8221;, \u5982\u679c\u6211\u628a\u4e0a\u9762\u7684\u4f8b\u5b50\u4fee\u6539\u6210\u8fd9\u6837: BeautifierPlugin Error: Unable to handle &#8220;bash&#8221; syntax.<br \/>\n#!\/bin\/sh<br \/>\necho &#8220;a=$a&#8221; ;<br \/>\n#\u4e0b\u9762\u589e\u52a0\u4e86readonly<br \/>\nreadonly a=2<br \/>\necho &#8220;a=$a&#8221; ;<br \/>\nunset a<br \/>\necho &#8220;a=$a&#8221; ;<br \/>\n\u5176\u7ed3\u679c\u5f53\u7136\u4f1a\u4e0d\u4e00\u6837\u4e86\uff1a BeautifierPlugin Error: Unable to handle &#8220;bash&#8221; syntax.<br \/>\n-bash-2.05b$ .\/test.sh<br \/>\na=<br \/>\na=2<br \/>\na=2<br \/>\n2.3 shell \u4e2d\u7684\u6570\u7ec4<\/p>\n<p>shell\u53d8\u91cf\u4e2d\u8fd8\u80fd\u8bbe\u7f6e\u6570\u7ec4\uff0c\u4f46\u662f\u4e0d\u540c\u7684shell\u7248\u672c\u6709\u4e0d\u540c\u6570\u7ec4\u8d4b\u503c\u65b9\u6cd5\uff0c\u800cbourne shell \u4e2d\u4e0d\u652f\u6301\u6570\u7ec4\u65b9\u5f0f\u3002\u56e0\u6b64\uff0c\u5982\u679c\u4e0d\u662f\u5341\u5206\u9700\u8981\uff0c\u8fd8\u662f\u5efa\u8bae\u4f60\u4e0d\u8981\u4f7f\u7528\u6570\u7ec4\u3002\u82e5\u4f60\u7684\u6570\u636e\u7ed3\u6784\u5341\u5206\u590d\u6742\uff0c\u5fc5\u987b\u8981\u4f7f\u7528\u6570\u7ec4\uff0c\u90a3\u4e48\u6211\u5efa\u8bae\u4f60\u8fd8\u662f\u9009\u62e9\u522b\u7684\u8bed\u8a00\u5427\uff0cshell\u4e0d\u662f\u4e07\u80fd\u7684\u3002<br \/>\nshell\u6709\u4e24\u79cd\u8d4b\u503c\u65b9\u5f0f\uff0c\u7b2c\u4e00\u79cd\u662f\u76f4\u63a5\u7528\u4e0b\u6807\u8d4b\u503c\uff1a BeautifierPlugin Error: Unable to handle &#8220;bash&#8221; syntax.<\/p>\n<p>name[0]=&#8221;Tom&#8221;<br \/>\nname[1]=&#8221;Tomy&#8221;<br \/>\nname[2]=&#8221;John&#8221;<br \/>\n&#8230;<br \/>\n\u53e6\u4e00\u79cd\u65b9\u5f0f\u5bf9\u4e8e\u4e0d\u540c\u7684shell\u7248\u672c\u4e0d\u4e00\u6837\u3002bash\u4e2d\u8d4b\u503c\uff1a BeautifierPlugin Error: Unable to handle &#8220;bash&#8221; syntax.<br \/>\n#!\/usr\/local\/bin\/bash<br \/>\nname=(&#8220;Tom&#8221; &#8220;Tomy&#8221; &#8220;John&#8221;)<br \/>\nfor i in 0 1 2<br \/>\ndo<br \/>\necho $i:${name[$i]} ;<br \/>\ndone;<br \/>\n\u4e0a\u9762\u4e24\u79cd\u8d4b\u503c\u65b9\u5f0f\u8fbe\u5230\u7684\u6548\u679c\u4e00\u6837\u3002\u53e6\u5916\uff0c\u4f60\u770b\u89c1\u8bbf\u95ee\u6570\u7ec4\u5143\u7d20\u7684\u65b9\u6cd5\u4e86\u5417\uff1f\u4f7f\u7528${name[index]}\u7684\u65b9\u5f0f\u3002\u6ce8\u610f\u7b2c\u4e00\u884c\u4f7f\u7528\u7684\u662f#!\/usr\/local\/bin\/bash, \u548c\u4ee5\u524d\u6709\u4e9b\u4e0d\u4e00\u6837\u54e6\u3002\u5176\u8f93\u51fa\u7ed3\u679c\u662f\uff1a BeautifierPlugin Error: Unable to handle &#8220;bash&#8221; syntax.<br \/>\n-bash-2.05b$ .\/test.sh<br \/>\n0:Tom<br \/>\n1:Tomy<br \/>\n2:John<\/p>\n<p>&nbsp;<\/p>\n<h3>3 shell \u73af\u5883\u53d8\u91cf<\/h3>\n<p>shell \u73af\u5883\u53d8\u91cf\u662f\u6240\u6709shell \u7a0b\u5e8f\u90fd\u4f1a\u63a5\u53d7\u7684\u53c2\u6570\u3002shell\u7a0b\u5e8f\u8fd0\u884c\u65f6\uff0c\u90fd\u4f1a\u63a5\u6536\u4e00\u7ec4\u53d8\u91cf\uff0c\u8fd9\u7ec4\u53d8\u91cf\u5c31\u662f\u73af\u5883\u53d8\u91cf\u3002\u5e38\u7528\u7684\u73af\u5883\u53d8\u91cf\uff1a<\/p>\n<table border=\"0\" cellspacing=\"1\" cellpadding=\"1\">\n<tbody>\n<tr>\n<td bgcolor=\"#eaeaea\">\u540d\u79f0<\/td>\n<td align=\"middle\" bgcolor=\"#eaeaea\">\u63cf\u8ff0<\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#ffffff\">PATH<\/td>\n<td bgcolor=\"#ffffff\">\u547d\u4ee4\u641c\u7d22\u8def\u5f84,\u4ee5\u5192\u53f7\u4e3a\u5206\u9694\u7b26.\u6ce8\u610f\u4e0eDOS\u4e0b\u4e0d\u540c\u7684\u662f, \u5f53\u524d\u76ee\u5f55\u4e0d\u5728\u7cfb\u7edf\u8def\u5f84\u91cc<\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#eaeaea\">HOME<\/td>\n<td bgcolor=\"#eaeaea\">\u7528\u6237home\u76ee\u5f55\u7684\u8def\u5f84\u540d,\u662fcd\u547d\u4ee4\u7684\u9ed8\u8ba4\u53c2\u6570<\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#ffffff\">COLUMNS<\/td>\n<td bgcolor=\"#ffffff\">\u5b9a\u4e49\u4e86\u547d\u4ee4\u7f16\u8f91\u6a21\u5f0f\u4e0b\u53ef\u4f7f\u7528\u547d\u4ee4\u884c\u7684\u957f\u5ea6<\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#eaeaea\">EDITOR<\/td>\n<td bgcolor=\"#eaeaea\">\u9ed8\u8ba4\u7684\u884c\u7f16\u8f91\u5668<\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#ffffff\">VISUAL<\/td>\n<td bgcolor=\"#ffffff\">\u9ed8\u8ba4\u7684\u53ef\u89c6\u7f16\u8f91\u5668<\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#eaeaea\">FCEDIT<\/td>\n<td bgcolor=\"#eaeaea\">\u547d\u4ee4fc\u4f7f\u7528\u7684\u7f16\u8f91\u5668<\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#ffffff\">HISTFILE<\/td>\n<td bgcolor=\"#ffffff\">\u547d\u4ee4\u5386\u53f2\u6587\u4ef6<\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#eaeaea\">HISTSIZE<\/td>\n<td bgcolor=\"#eaeaea\">\u547d\u4ee4\u5386\u53f2\u6587\u4ef6\u4e2d\u6700\u591a\u53ef\u5305\u542b\u7684\u547d\u4ee4\u6761\u6570<\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#ffffff\">HISTFILESIZE<\/td>\n<td bgcolor=\"#ffffff\">\u547d\u4ee4\u5386\u53f2\u6587\u4ef6\u4e2d\u5305\u542b\u7684\u6700\u5927\u884c\u6570<\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#eaeaea\">IFS<\/td>\n<td bgcolor=\"#eaeaea\">\u5b9a\u4e49SHELL\u4f7f\u7528\u7684\u5206\u9694\u7b26<\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#ffffff\">LOGNAME<\/td>\n<td bgcolor=\"#ffffff\">\u7528\u6237\u767b\u5f55\u540d<\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#eaeaea\">MAIL<\/td>\n<td bgcolor=\"#eaeaea\">\u6307\u5411\u4e00\u4e2a\u9700\u8981SHELL\u76d1\u89c6\u5176\u4fee\u6539\u65f6\u95f4\u7684\u6587\u4ef6.\u5f53\u8be5\u6587\u4ef6\u4fee\u6539\u540e, SHELL\u5c06\u53d1\u6d88\u606fYou hava mail\u7ed9\u7528\u6237<\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#ffffff\">MAILCHECK<\/td>\n<td bgcolor=\"#ffffff\">SHELL\u68c0\u67e5MAIL\u6587\u4ef6\u7684\u5468\u671f,\u5355\u4f4d\u662f\u79d2<\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#eaeaea\">MAILPATH<\/td>\n<td bgcolor=\"#eaeaea\">\u529f\u80fd\u4e0eMAIL\u7c7b\u4f3c.\u4f46\u53ef\u4ee5\u7528\u4e00\u7ec4\u6587\u4ef6,\u4ee5\u5192\u53f7\u5206\u9694,\u6bcf\u4e2a\u6587\u4ef6\u540e\u53ef\u8ddf\u4e00\u4e2a\u95ee\u53f7\u548c\u4e00\u6761\u53d1\u5411\u7528\u6237\u7684\u6d88\u606f<\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#ffffff\">SHELL<\/td>\n<td bgcolor=\"#ffffff\">SHELL\u7684\u8def\u5f84\u540d<\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#eaeaea\">TERM<\/td>\n<td bgcolor=\"#eaeaea\">\u7ec8\u7aef\u7c7b\u578b<\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#ffffff\">TMOUT<\/td>\n<td bgcolor=\"#ffffff\">SHELL\u81ea\u52a8\u9000\u51fa\u7684\u65f6\u95f4,\u5355\u4f4d\u4e3a\u79d2,\u82e5\u8bbe\u4e3a0\u5219\u7981\u6b62SHELL\u81ea\u52a8\u9000\u51fa<\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#eaeaea\">PROMPT_COMMAND<\/td>\n<td bgcolor=\"#eaeaea\">\u6307\u5b9a\u5728\u4e3b\u547d\u4ee4\u63d0\u793a\u7b26\u524d\u5e94\u6267\u884c\u7684\u547d\u4ee4<\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#ffffff\">PS1<\/td>\n<td bgcolor=\"#ffffff\">\u4e3b\u547d\u4ee4\u63d0\u793a\u7b26<\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#eaeaea\">PS2<\/td>\n<td bgcolor=\"#eaeaea\">\u4e8c\u7ea7\u547d\u4ee4\u63d0\u793a\u7b26,\u547d\u4ee4\u6267\u884c\u8fc7\u7a0b\u4e2d\u8981\u6c42\u8f93\u5165\u6570\u636e\u65f6\u7528<\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#ffffff\">PS3<\/td>\n<td bgcolor=\"#ffffff\">select\u7684\u547d\u4ee4\u63d0\u793a\u7b26<\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#eaeaea\">PS4<\/td>\n<td bgcolor=\"#eaeaea\">\u8c03\u8bd5\u547d\u4ee4\u63d0\u793a\u7b26<\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#ffffff\">MANPATH<\/td>\n<td bgcolor=\"#ffffff\">\u5bfb\u627e\u624b\u518c\u9875\u7684\u8def\u5f84,\u4ee5\u5192\u53f7\u5206\u9694<\/td>\n<\/tr>\n<tr>\n<td bgcolor=\"#eaeaea\">LD_LIBRARY_PATH<\/td>\n<td bgcolor=\"#eaeaea\">\u5bfb\u627e\u5e93\u7684\u8def\u5f84,\u4ee5\u5192\u53f7\u5206\u9694<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u8fd9\u4e9b\u53d8\u91cf\uff0c\u8981\u5173\u6ce8\u7684\u6700\u591a\u7684\u5c31\u662fPATH, \u5176\u91cd\u8981\u6027\u4e0d\u8981\u6211\u8bf4\u4e86\u5427\uff1f<\/p>\n<p>\u5982\u679c\u4f60\u5e0c\u671b\u628a\u4f60\u5b9a\u4e49\u7684\u53d8\u91cf\u8ba9\u5176\u4ed6\u6240\u6709\u7684shell\u7a0b\u5e8f\u90fd\u80fd\u4f7f\u7528\uff0c\u4e5f\u5c31\u662f\u5b9a\u4e49\u65b0\u7684\u73af\u5883\u53d8\u91cf\u3002\u4f60\u53ea\u8981\u4f7f\u7528export\u5173\u952e\u8bcd\u5c31\u53ef\u4ee5\u4e86\u3002\u4f8b\u5982\uff1a BeautifierPlugin Error: Unable to handle &#8220;bash&#8221; syntax.<\/p>\n<p>export MY_NAME=Winter<br \/>\nexport PATH=\/home\/winter\/bin:$PATH<br \/>\n\u4e0a\u9762\u7684\u7a0b\u5e8f\u4e2d\uff0c\u7b2c\u4e00\u884c\u8f93\u51faMY_NAME\u53d8\u91cf\uff0c\u7b2c\u4e8c\u884c\u662f\u5728\u73af\u5883\u53d8\u91cfPATH\u4e2d\u589e\u52a0\u4e00\u4e2a\u8def\u5f84\/home\/winter\/bin \u3002\u5982\u679c\u4f60\u5e0c\u671b\u8fd9\u4e9b\u8bbe\u7f6e\u5728\u4f60\u767b\u9646unix\/linux\u90fd\u6709\u6548\uff0c\u4f60\u9700\u8981\u628a\u4ed6\u4eec\u52a0\u5165\u5230\u4f60\u7684shell\u542f\u52a8\u811a\u672c\u4e2d, \u5982\u679c\u662f\u4f7f\u7528bash BeautifierPlugin Error: Unable to handle &#8220;bash&#8221; syntax.<br \/>\n~\/.bash_profile<br \/>\n\u5176\u4ed6\u7248\u672c\u4f60\u770b\u4e00\u773c\u5c31\u77e5\u9053\u4e86\uff0c\u5728\u4f60\u7684home\u76ee\u5f55\u4e0b\uff0c\u4ee5&#8221;.&#8221;\u5f00\u5934\u7684\u6587\u4ef6\uff0c\u4e00\u822c\u90fd\u4f1a\u9690\u85cf\u8d77\u6765\uff0c\u4f60\u9700\u8981\u4f7f\u7528\u2018ls -al\u2018\u547d\u4ee4\u6765\u663e\u793a\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7cfb\u7edf\u53d8\u91cf\uff0c\u73af\u5883\u53d8\u91cf\uff0c\u7528\u6237\u53d8\u91cf \u5176\u4e2d\u7528\u6237\u53d8\u91cf\u5728\u7f16\u7a0b\u8fc7\u7a0b\u4e2d\u4f7f\u7528\u6700\u591a\uff0c\u7cfb\u7edf\u53d8\u91cf\u5728\u5bf9\u53c2\u6570\u5224\u65ad\u548c\u547d\u4ee4\u8fd4\u56de\u503c\u5224\u65ad\u4f1a\u4f7f\u7528\uff0c\u73af\u5883\u53d8\u91cf\u4e3b\u8981\u662f\u5728\u7a0b\u5e8f\u8fd0\u884c\u7684\u65f6\u5019\u9700\u8981\u8bbe\u7f6e 1 \u7cfb\u7edf\u53d8\u91cf Shell\u5e38\u7528\u7684\u7cfb\u7edf\u53d8\u91cf\u5e76\u4e0d\u591a\uff0c\u4f46\u5374\u5341\u5206\u6709\u7528\uff0c\u7279\u522b\u662f\u5728\u505a\u4e00\u4e9b\u53c2\u6570\u68c0\u6d4b\u7684\u65f6\u5019\u3002\u4e0b\u9762\u662fShell\u5e38\u7528\u7684\u7cfb\u7edf\u53d8\u91cf \u8868\u793a\u65b9\u6cd5 \u63cf\u8ff0 $n $1 \u8868\u793a\u7b2c\u4e00\u4e2a\u53c2\u6570\uff0c$2 \u8868\u793a\u7b2c\u4e8c\u4e2a\u53c2\u6570 &#8230; $# \u547d\u4ee4\u884c\u53c2\u6570\u7684\u4e2a\u6570 $0 \u5f53\u524d\u7a0b\u5e8f\u7684\u540d\u79f0 $? \u524d\u4e00\u4e2a\u547d\u4ee4\u6216\u51fd\u6570\u7684\u8fd4\u56de\u7801 $* \u4ee5&#8221;\u53c2\u65701 \u53c2\u65702 &#8230; &#8221; \u5f62\u5f0f\u4fdd\u5b58\u6240\u6709\u53c2\u6570 $@ \u4ee5&#8221;\u53c2\u65701&#8243; &#8220;\u53c2\u65702&#8221; &#8230; \u5f62\u5f0f\u4fdd\u5b58\u6240\u6709\u53c2\u6570 $$ \u672c\u7a0b\u5e8f\u7684(\u8fdb\u7a0bID\u53f7)PID $! \u4e0a\u4e00\u4e2a\u547d\u4ee4\u7684PID 2 Shell\u7528\u6237\u53d8\u91cf 2.1 \u57fa\u7840 \u4e0d\u7ba1\u7cfb\u7edf\u53d8\u91cf\u6709\u591a\u5c11\uff0c\u5bf9\u4e8e\u9700\u6c42\u6765\u8bf4\uff0c\u603b\u662f\u4e0d\u591f\u7684\u3002\u7528\u6237\u53d8\u91cf\u662f\u6700\u5e38\u7528\u5230\u7684\u53d8\u91cf\uff0c\u4f7f\u7528\u4e5f\u5341\u5206\u7b80\u5355\u3002 \u7528\u6237\u5b9a\u4e49\u7684\u53d8\u91cf\u5fc5\u987b\u7531\u5b57\u6bcd\u6570\u5b57\u53ca\u4e0b\u5212\u7ebf\u7ec4\u6210,\u5e76\u4e14\u53d8\u91cf\u540d\u7684\u7b2c\u4e00\u4e2a\u5b57\u7b26\u4e0d\u80fd\u4e3a\u6570\u5b57, \u4e0e\u5176\u5b83UNIX\u540d\u5b57\u4e00\u6837,\u53d8\u91cf\u540d\u662f\u5927\u5c0f\u5199\u654f\u611f\u7684. \u5bf9\u4e8e\u7528\u6237\u53d8\u91cf,\u7528\u6237\u53ef\u6309\u5982\u4e0b\u65b9\u5f0f\u8d4b\u503c: BeautifierPlugin Error: Unable to handle &#8220;bash&#8221; syntax. name=&#8221;Winter&#8221; \u5728\u5f15\u7528\u53d8\u91cf\u65f6,\u9700\u5728\u524d\u9762\u52a0$\u7b26\u53f7\uff0c\u7528\u6237\u4e5f\u53ef\u4ee5\u5728\u53d8\u91cf\u95f4\u8fdb\u884c\u76f8\u4e92\u8d4b\u503c,\u5982: BeautifierPlugin Error: Unable to handle [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-3123","post","type-post","status-publish","format-standard","hentry","category-life"],"_links":{"self":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/3123","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3123"}],"version-history":[{"count":2,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/3123\/revisions"}],"predecessor-version":[{"id":3657,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/3123\/revisions\/3657"}],"wp:attachment":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3123"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3123"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3123"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}