R1-012 Shell执行命令的顺序

本文介绍了交互Shell在执行用户命令时的搜索机制。Shell并非直接在PATH环境变量指定的路径中查找命令,而是遵循一个固定的顺序:先检查命令是否为别名、关键字、函数或内置命令,最后才在PATH路径中查找外部命令。
交互Shell在获得用户输入时,并不是直接就在PATH路径中查找,而是按照固定顺序依次寻找命令位置。搜索顺序为:
别名
关键字
函数
内置命令
外部命令:即脚本或可执行程序,这才在PATH路径中查找。

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29067253/viewspace-2134791/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/29067253/viewspace-2134791/

🔹 配置路由器间静态路由... ✅ 网络启动完成。正在打开 CLI... *** Starting CLI: mininet> pingall *** Ping: testing ping reachability h1 -> X X X X ^C Interrupt stopping h1 mininet> dump <Host h1: h1-eth0:10.0.1.10 pid=43344> <Host h2: h2-eth0:10.0.1.11 pid=43346> <Host h3: h3-eth0:10.0.2.10 pid=43348> <Host h4: h4-eth0:10.0.2.11 pid=43350> <Host h5: h5-eth0:10.0.3.10 pid=43352> <Host h6: h6-eth0:10.0.3.11 pid=43354> <Host h7: h7-eth0:10.0.4.10 pid=43356> <Host h8: h8-eth0:10.0.4.11 pid=43358> <LinuxRouter r1: r1-eth0:10.0.1.1 pid=43362> <LinuxRouter r2: r2-eth0:10.0.2.1 pid=43364> <LinuxRouter r3: r3-eth0:10.0.3.1 pid=43366> <LinuxRouter r4: r4-eth0:10.0.4.1 pid=43368> <OVSSwitch a1: lo:127.0.0.1,a1-eth1:None,a1-eth2:None,a1-eth3:None,a1-eth4:None,a1-eth5:None,a1-eth6:None pid=43373> <OVSSwitch a2: lo:127.0.0.1,a2-eth1:None,a2-eth2:None,a2-eth3:None,a2-eth4:None,a2-eth5:None,a2-eth6:None pid=43376> <OVSSwitch a3: lo:127.0.0.1,a3-eth1:None,a3-eth2:None,a3-eth3:None,a3-eth4:None,a3-eth5:None,a3-eth6:None pid=43379> <OVSSwitch a4: lo:127.0.0.1,a4-eth1:None,a4-eth2:None,a4-eth3:None,a4-eth4:None,a4-eth5:None,a4-eth6:None pid=43382> <OVSSwitch a5: lo:127.0.0.1,a5-eth1:None,a5-eth2:None,a5-eth3:None,a5-eth4:None,a5-eth5:None,a5-eth6:None pid=43385> <OVSSwitch a6: lo:127.0.0.1,a6-eth1:None,a6-eth2:None,a6-eth3:None,a6-eth4:None,a6-eth5:None,a6-eth6:None pid=43388> <OVSSwitch a7: lo:127.0.0.1,a7-eth1:None,a7-eth2:None,a7-eth3:None,a7-eth4:None,a7-eth5:None,a7-eth6:None pid=43391> <OVSSwitch a8: lo:127.0.0.1,a8-eth1:None,a8-eth2:None,a8-eth3:None,a8-eth4:None,a8-eth5:None,a8-eth6:None pid=43394> <OVSSwitch c1: lo:127.0.0.1,c1-eth1:None,c1-eth2:None,c1-eth3:None,c1-eth4:None,c1-eth5:None,c1-eth6:None,c1-eth7:None,c1-eth8:None pid=43397> <OVSSwitch c2: lo:127.0.0.1,c2-eth1:None,c2-eth2:None,c2-eth3:None,c2-eth4:None,c2-eth5:None,c2-eth6:None,c2-eth7:None,c2-eth8:None pid=43400> <OVSSwitch c3: lo:127.0.0.1,c3-eth1:None,c3-eth2:None,c3-eth3:None,c3-eth4:None,c3-eth5:None,c3-eth6:None,c3-eth7:None,c3-eth8:None pid=43403> <OVSSwitch c4: lo:127.0.0.1,c4-eth1:None,c4-eth2:None,c4-eth3:None,c4-eth4:None,c4-eth5:None,c4-eth6:None,c4-eth7:None,c4-eth8:None pid=43406> <OVSSwitch s1: lo:127.0.0.1,s1-eth1:None,s1-eth2:None,s1-eth3:None,r1-eth0:10.0.1.1 pid=43409> <OVSSwitch s2: lo:127.0.0.1,s2-eth1:None,s2-eth2:None,s2-eth3:None pid=43412> <OVSSwitch s3: lo:127.0.0.1,s3-eth1:None,s3-eth2:None,s3-eth3:None,r2-eth0:10.0.2.1 pid=43415> <OVSSwitch s4: lo:127.0.0.1,s4-eth1:None,s4-eth2:None,s4-eth3:None pid=43418> <OVSSwitch s5: lo:127.0.0.1,s5-eth1:None,s5-eth2:None,s5-eth3:None,r3-eth0:10.0.3.1 pid=43421> <OVSSwitch s6: lo:127.0.0.1,s6-eth1:None,s6-eth2:None,s6-eth3:None pid=43424> <OVSSwitch s7: lo:127.0.0.1,s7-eth1:None,s7-eth2:None,s7-eth3:None,r4-eth0:10.0.4.1 pid=43427> <OVSSwitch s8: lo:127.0.0.1,s8-eth1:None,s8-eth2:None,s8-eth3:None pid=43430> <RemoteController c0: 127.0.0.1:6653 pid=44512> mininet> s1 dpctl show bash: dpctl: command not found mininet> net h1 h1-eth0:s1-eth3 h2 h2-eth0:s2-eth3 h3 h3-eth0:s3-eth3 h4 h4-eth0:s4-eth3 h5 h5-eth0:s5-eth3 h6 h6-eth0:s6-eth3 h7 h7-eth0:s7-eth3 h8 h8-eth0:s8-eth3 r1 r1-eth0:r1-eth0 r2 r2-eth0:r2-eth0 r3 r3-eth0:r3-eth0 r4 r4-eth0:r4-eth0 a1 lo: a1-eth1:c1-eth1 a1-eth2:c2-eth1 a1-eth3:c3-eth1 a1-eth4:c4-eth1 a1-eth5:s1-eth1 a1-eth6:s2-eth1 a2 lo: a2-eth1:c1-eth2 a2-eth2:c2-eth2 a2-eth3:c3-eth2 a2-eth4:c4-eth2 a2-eth5:s1-eth2 a2-eth6:s2-eth2 a3 lo: a3-eth1:c1-eth3 a3-eth2:c2-eth3 a3-eth3:c3-eth3 a3-eth4:c4-eth3 a3-eth5:s3-eth1 a3-eth6:s4-eth1 a4 lo: a4-eth1:c1-eth4 a4-eth2:c2-eth4 a4-eth3:c3-eth4 a4-eth4:c4-eth4 a4-eth5:s3-eth2 a4-eth6:s4-eth2 a5 lo: a5-eth1:c1-eth5 a5-eth2:c2-eth5 a5-eth3:c3-eth5 a5-eth4:c4-eth5 a5-eth5:s5-eth1 a5-eth6:s6-eth1 a6 lo: a6-eth1:c1-eth6 a6-eth2:c2-eth6 a6-eth3:c3-eth6 a6-eth4:c4-eth6 a6-eth5:s5-eth2 a6-eth6:s6-eth2 a7 lo: a7-eth1:c1-eth7 a7-eth2:c2-eth7 a7-eth3:c3-eth7 a7-eth4:c4-eth7 a7-eth5:s7-eth1 a7-eth6:s8-eth1 a8 lo: a8-eth1:c1-eth8 a8-eth2:c2-eth8 a8-eth3:c3-eth8 a8-eth4:c4-eth8 a8-eth5:s7-eth2 a8-eth6:s8-eth2 c1 lo: c1-eth1:a1-eth1 c1-eth2:a2-eth1 c1-eth3:a3-eth1 c1-eth4:a4-eth1 c1-eth5:a5-eth1 c1-eth6:a6-eth1 c1-eth7:a7-eth1 c1-eth8:a8-eth1 c2 lo: c2-eth1:a1-eth2 c2-eth2:a2-eth2 c2-eth3:a3-eth2 c2-eth4:a4-eth2 c2-eth5:a5-eth2 c2-eth6:a6-eth2 c2-eth7:a7-eth2 c2-eth8:a8-eth2 c3 lo: c3-eth1:a1-eth3 c3-eth2:a2-eth3 c3-eth3:a3-eth3 c3-eth4:a4-eth3 c3-eth5:a5-eth3 c3-eth6:a6-eth3 c3-eth7:a7-eth3 c3-eth8:a8-eth3 c4 lo: c4-eth1:a1-eth4 c4-eth2:a2-eth4 c4-eth3:a3-eth4 c4-eth4:a4-eth4 c4-eth5:a5-eth4 c4-eth6:a6-eth4 c4-eth7:a7-eth4 c4-eth8:a8-eth4 s1 lo: s1-eth1:a1-eth5 s1-eth2:a2-eth5 s1-eth3:h1-eth0 r1-eth0:r1-eth0 s2 lo: s2-eth1:a1-eth6 s2-eth2:a2-eth6 s2-eth3:h2-eth0 s3 lo: s3-eth1:a3-eth5 s3-eth2:a4-eth5 s3-eth3:h3-eth0 r2-eth0:r2-eth0 s4 lo: s4-eth1:a3-eth6 s4-eth2:a4-eth6 s4-eth3:h4-eth0 s5 lo: s5-eth1:a5-eth5 s5-eth2:a6-eth5 s5-eth3:h5-eth0 r3-eth0:r3-eth0 s6 lo: s6-eth1:a5-eth6 s6-eth2:a6-eth6 s6-eth3:h6-eth0 s7 lo: s7-eth1:a7-eth5 s7-eth2:a8-eth5 s7-eth3:h7-eth0 r4-eth0:r4-eth0 s8 lo: s8-eth1:a7-eth6 s8-eth2:a8-eth6 s8-eth3:h8-eth0 c0 mininet> stop *** Unknown command: stop mininet> start *** Unknown command: start mininet>
12-18
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值