{"id":5483,"date":"2019-11-27T18:11:08","date_gmt":"2019-11-27T10:11:08","guid":{"rendered":"https:\/\/www.linuxcool.com\/?p=5483"},"modified":"2022-05-22T13:47:21","modified_gmt":"2022-05-22T05:47:21","slug":"sh","status":"publish","type":"post","link":"https:\/\/www.linuxcool.com\/sh","title":{"rendered":"sh\u547d\u4ee4 – shell\u547d\u4ee4\u8bed\u8a00\u89e3\u91ca\u5668"},"content":{"rendered":"\n

sh\u547d\u4ee4\u6765\u81ea\u4e8e\u82f1\u6587\u5355\u8bcdshell\u7684\u7f29\u5199\uff0c\u5176\u529f\u80fd\u662fShell\u547d\u4ee4\u8bed\u8a00\u7684\u89e3\u91ca\u5668\u3002sh\u5176\u5b9e\u5e76\u4e0d\u662f\u4e00\u4e2a\u5b9e\u9645\u5b58\u5728\u7684\u547d\u4ee4\u6587\u4ef6\uff0c\u800c\u662fbash\u7684\u522b\u540d\u547d\u4ee4\u800c\u5df2\uff0c\u4f5c\u4e3a\u4eba\u4e0e\u7cfb\u7edf\u7684\u7ffb\u8bd1\u5b98\u3002<\/p>\n\n\n\n

\u8bed\u6cd5\u683c\u5f0f\uff1a<\/strong>sh [\u53c2\u6570] \u811a\u672c<\/p>\n\n\n\n

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

-c<\/td>\u547d\u4ee4\u4ece\u5b57\u7b26\u4e32\u8bfb\u53d6 <\/td><\/tr>
-i <\/td>\u5b9e\u73b0\u811a\u672c\u4ea4\u4e92 <\/td><\/tr>
-n <\/td>\u8fdb\u884c\u8bed\u6cd5\u68c0\u67e5 <\/td><\/tr>
-x <\/td>\u5b9e\u73b0\u9010\u6761\u8bed\u53e5\u7684\u8ddf\u8e2a <\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n

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

\u6267\u884c\u6307\u5b9a\u7684\u811a\u672c\u6587\u4ef6\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# sh linuxcool.sh <\/strong>\r\n\/root\r\n 21:33:45 up 42 min,  1 user,  load average: 0.06, 0.01, 0.00\r<\/pre>\n\n\n\n

\u6267\u884c\u6307\u5b9a\u7684\u811a\u672c\u6587\u4ef6\uff0c\u5e76\u9010\u6761\u547d\u4ee4\u8fdb\u884c\u8ffd\u8e2a\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# sh -x linuxcool.sh <\/strong>\r\n+ pwd\r\n\/root\r\n+ uptime\r\n 21:33:50 up 42 min,  1 user,  load average: 0.05, 0.01, 0.00\r<\/pre>\n","protected":false},"excerpt":{"rendered":"

sh\u547d\u4ee4\u6765\u81ea\u4e8e\u82f1\u6587\u5355\u8bcdshell\u7684\u7f29\u5199\uff0c\u5176\u529f\u80fd\u662fShell\u547d\u4ee4\u8bed\u8a00\u7684\u89e3\u91ca\u5668\u3002sh\u5176\u5b9e\u5e76\u4e0d\u662f\u4e00\u4e2a\u5b9e\u9645\u5b58\u5728\u7684\u547d\u4ee4\u6587 […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[7],"tags":[],"_links":{"self":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/5483"}],"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=5483"}],"version-history":[{"count":12,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/5483\/revisions"}],"predecessor-version":[{"id":9916,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/5483\/revisions\/9916"}],"wp:attachment":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/media?parent=5483"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/categories?post=5483"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/tags?post=5483"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}