{"id":5104,"date":"2019-10-18T18:51:23","date_gmt":"2019-10-18T10:51:23","guid":{"rendered":"https:\/\/www.linuxcool.com\/?p=5104"},"modified":"2019-10-23T10:07:07","modified_gmt":"2019-10-23T02:07:07","slug":"builtin","status":"publish","type":"post","link":"https:\/\/www.linuxcool.com\/builtin","title":{"rendered":"builtin\u547d\u4ee4 – \u6267\u884cbash\u5185\u5efa\u547d\u4ee4"},"content":{"rendered":"\n

builtin\u547d\u4ee4\u7528\u4e8e\u6267\u884c\u6307\u5b9a\u7684bash\u5185\u5efa\u547d\u4ee4\uff0c builtin\u547d\u4ee4\u8c03\u7528\u7684bash\u5185\u5efa\u547d\u4ee4\u4f18\u5148\u4e8e\u540c\u540d\u7684\u5916\u90e8\u547d\u4ee4\u53ca\u540c\u540d\u7684shell\u51fd\u6570\u3002 \u8fd4\u56de\u8be5\u5185\u5efa\u547d\u4ee4\u6267\u884c\u7684\u8fd4\u56de\u503c\uff0c\u9664\u975e\u4f20\u9012\u7684\u4e0d\u662fbash\u5185\u5efa\u547d\u4ee4\u6216\u8be5\u5185\u5efa\u547d\u4ee4\u88ab\u7981\u7528\u3002 <\/p>\n\n\n\n

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

\u5e38\u7528\u53c2\u6570\uff1a<\/strong><\/p>\n\n\n\n
shell-builtin <\/td>\u8981\u8c03\u7528\u7684bash\u5185\u5efa\u547d\u4ee4 <\/td><\/tr>
arg<\/td>\u4f20\u9012\u7ed9bash\u5185\u5efa\u547d\u4ee4\u7684\u4e00\u5230\u591a\u4e2a\u53c2\u6570 <\/td><\/tr><\/tbody><\/table>\n\n\n\n

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

\u540c\u540d\u60c5\u51b5\u4e0b\u7684\u4f18\u5148\u7ea7\u987a\u5e8f\uff1abuiltin \u5185\u5efa\u547d\u4ee4 > \u51fd\u6570 > \u5185\u5efa\u547d\u4ee4 > \u5916\u90e8\u547d\u4ee4\uff1a <\/p>\n\n\n\n

[root@linuxcool ~]# echo \"the Great Wall\" \n[root@linuxcool ~]# type -t echo \n[root@linuxcool ~]# echo(){printf \"123\\n\" } \n[root@linuxcool ~]# echo \n[root@linuxcool ~]# type -t echo \n[root@linuxcool ~]# builtin echo -e \"backslash \\\\\" <\/pre>\n\n\n\n

\u6267\u884cshell\u5185\u90e8\u6307\u4ee4\uff0c\u8f93\u51fa\u5f53\u524d\u7cfb\u7edf\u4e0b\u7684\u547d\u4ee4\u522b\u540d \uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# builtin alias \n[root@linuxcool ~]# alias cp='cp -i'  \n[root@linuxcool ~]# alias l.='ls -d .* --color=tty'  \n[root@linuxcool ~]# alias ll='ls -l --color=tty'  \n[root@linuxcool ~]# alias ls='ls --color=tty'  \n[root@linuxcool ~]# alias mv='mv -i'  \n[root@linuxcool ~]# alias rm='rm -i'  \n[root@linuxcool ~]# alias which='alias | \/usr\/bin\/which --tty-only --read-alias --show-dot --show-tilde'  <\/pre>\n","protected":false},"excerpt":{"rendered":"

builtin\u547d\u4ee4\u7528\u4e8e\u6267\u884c\u6307\u5b9a\u7684bash\u5185\u5efa\u547d\u4ee4\uff0c builtin\u547d\u4ee4\u8c03\u7528\u7684bash\u5185\u5efa\u547d\u4ee4\u4f18\u5148\u4e8e\u540c\u540d\u7684\u5916\u90e8\u547d […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[11],"tags":[],"_links":{"self":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/5104"}],"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=5104"}],"version-history":[{"count":9,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/5104\/revisions"}],"predecessor-version":[{"id":5268,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/5104\/revisions\/5268"}],"wp:attachment":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/media?parent=5104"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/categories?post=5104"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/tags?post=5104"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}