我這邊執(zhí)行第二步出現(xiàn)了結(jié)果。但是第三步?jīng)]有變化。
ifconfig eth0 | sed -n '/inet /p'| sed 's/ine .*r:\([0-9.]\+\).*$/\1/'
? ? ? ? ? inet addr:10.0.2.15 ?Bcast:10.0.2.255 ?Mask:255.255.255.0
ifconfig eth0 | sed -n '/inet /p'| sed 's/ine .*r:\([0-9.]\+\).*$/\1/'
? ? ? ? ? inet addr:10.0.2.15 ?Bcast:10.0.2.255 ?Mask:255.255.255.0
2018-06-08
舉報
2019-02-15
我這邊加了空格,還是不行
2018-07-01
少了一個空格,改成:
2018-06-08
dba@dba-ze:~$ ifconfig eth0 | sed -n '/inet /p'| sed 's/ine.*:\([0-9.]\+\) .*$/\1'/
? ? ? ? ? 10.0.2.255
dba@dba-ze:~$ ifconfig eth0 | sed -n '/inet /p'| sed 's/ine.*:\([0-9.]\+\) .*$/\1/'
? ? ? ? ? 10.0.2.255
dba@dba-ze:~$ ifconfig eth0 | sed -n '/inet /p'| sed 's/ine.*r:\([0-9.]\+\) .*$/\1/'
? ? ? ? ? 10.0.2.15