{"id":2108,"date":"2019-05-24T23:45:50","date_gmt":"2019-05-24T15:45:50","guid":{"rendered":"https:\/\/www.linuxcool.com\/?p=2108"},"modified":"2022-05-25T15:43:34","modified_gmt":"2022-05-25T07:43:34","slug":"read","status":"publish","type":"post","link":"https:\/\/www.linuxcool.com\/read","title":{"rendered":"read – \u8bfb\u53d6\u5355\u884c\u6570\u636e\u5185\u5bb9"},"content":{"rendered":"\n

read\u547d\u4ee4\u7684\u529f\u80fd\u662f\u7528\u4e8e\u8bfb\u53d6\u5355\u884c\u6570\u636e\u5185\u5bb9\uff0c\u4e00\u822c\u662f\u4ece\u6807\u51c6\u8f93\u5165\u4e2d\u8bfb\u53d6\u6570\u503c\uff0c\u7528\u4e8e\u7ed9\u53d8\u91cf\u8d4b\u503c\u3002<\/p>\n\n\n\n

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

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

-a <\/td>\u5b9a\u4e49\u4e00\u4e2a\u6570\u7ec4\uff0c\u4ee5\u7a7a\u683c\u4e3a\u95f4\u9694\u7b26\u8fdb\u884c\u8d4b\u503c<\/td><\/tr>
-d <\/td>\u5b9a\u4e49\u4e00\u4e2a\u7ed3\u675f\u6807\u5fd7<\/td><\/tr>
-p<\/td>\u8bbe\u7f6e\u63d0\u793a\u4fe1\u606f<\/td><\/tr>
-e<\/td>\u5728\u8f93\u5165\u7684\u65f6\u5019\u53ef\u4ee5\u4f7f\u7528\u547d\u4ee4\u8865\u5168\u529f\u80fd<\/td><\/tr>
-n<\/td>\u5b9a\u4e49\u8f93\u5165\u6587\u672c\u7684\u957f\u5ea6<\/td><\/tr>
-r<\/td>\u7981\u7528\u8f6c\u4e49\u7b26\uff08\\\uff09<\/td><\/tr>
-s<\/td>\u8f93\u5165\u5b57\u7b26\u4e0d\u5728\u5c4f\u5e55\u663e\u793a<\/td><\/tr>
-t<\/td>\u9650\u5b9a\u6700\u957f\u7b49\u5f85\u65f6\u95f4<\/td><\/tr>
-u<\/td>\u4ece\u6587\u4ef6\u63cf\u8ff0\u7b26\u4e2d\u8bfb\u5165\u4fe1\u606f<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n

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

\u901a\u8fc7\u7528\u6237\u7684\u8f93\u5165\u64cd\u4f5c\uff0c\u7ed9\u6307\u5b9a\u7684\u53d8\u91cf\u8d4b\u503c\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# read website <\/strong>\nwww.linuxprobe.com<\/strong><\/pre>\n\n\n\n

\u7ed9\u51fa\u4e00\u4e9b\u63d0\u793a\u4fe1\u606f\uff0c\u8ba9\u7528\u6237\u8fdb\u884c\u8f93\u5165\u64cd\u4f5c\uff0c\u7ed9\u6307\u5b9a\u7684\u53d8\u91cf\u8d4b\u503c\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# read -p \"INPUT: \"  website<\/strong>\nINPUT: www.linuxprobe.com<\/strong><\/pre>\n\n\n\n

\u9650\u5b9a10\u79d2\u949f\u5185\uff0c\u8ba9\u7528\u6237\u8fdb\u884c\u8f93\u5165\u64cd\u4f5c\uff0c\u7ed9\u6307\u5b9a\u7684\u53d8\u91cf\u8d4b\u503c\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# read -p \"INPUT: \" -t 10 website<\/strong>\nINPUT: www.linuxprobe.com<\/strong><\/pre>\n\n\n\n

\u9650\u5b9a\u6700\u5927\u8f93\u5165\u5b57\u7b26\u6570\u91cf\uff0c\u8ba9\u7528\u6237\u8fdb\u884c\u8f93\u5165\u64cd\u4f5c\uff0c\u7ed9\u6307\u5b9a\u7684\u53d8\u91cf\u8d4b\u503c\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# read -p \"INPUT: \" -n 7 website<\/strong>\nINPUT: 1234567<\/strong><\/pre>\n\n\n\n

\u9690\u85cf\u5b57\u7b26\u5185\u5bb9\uff0c\u8ba9\u7528\u6237\u8fdb\u884c\u8f93\u5165\u64cd\u4f5c\uff0c\u7ed9\u6307\u5b9a\u7684\u53d8\u91cf\u8d4b\u503c\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# read -s -p \"INPUT: \" website<\/strong>\nINPUT: <\/pre>\n","protected":false},"excerpt":{"rendered":"

read\u547d\u4ee4\u7684\u529f\u80fd\u662f\u7528\u4e8e\u8bfb\u53d6\u5355\u884c\u6570\u636e\u5185\u5bb9\uff0c\u4e00\u822c\u662f\u4ece\u6807\u51c6\u8f93\u5165\u4e2d\u8bfb\u53d6\u6570\u503c\uff0c\u7528\u4e8e\u7ed9\u53d8\u91cf\u8d4b\u503c\u3002 \u8bed\u6cd5\u683c\u5f0f\uff1aread [ […]<\/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\/2108"}],"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=2108"}],"version-history":[{"count":18,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/2108\/revisions"}],"predecessor-version":[{"id":10024,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/2108\/revisions\/10024"}],"wp:attachment":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/media?parent=2108"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/categories?post=2108"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/tags?post=2108"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}