慕少森
1[root@YYStorage2 ~]# cat test.sh12#!/bin/shdmesg|grep $11[root@YYStorage2 ~]# chmod +x test.sh1[root@YYStorage2 ~]# ./test.sh ethe1000: eth0: e1000_probe: Intel(R) PRO/1000 Network Connectione1000: eth0 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: Noneeth0: no IPv6 routers presentADDRCONF(NETDEV_UP): eth0: link is not readye1000: eth0 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: NoneADDRCONF(NETDEV_CHANGE): eth0: link becomes readyeth0: no IPv6 routers presente1000: eth0 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: Noneeth0: no IPv6 routers present解释一下吧:在shell中的变量有$?,$1...$9$1代表第一个变量,$2代表第二个,依次类推,一直到$9