zyme 回复于:2003-05-21 09:56:15 |
ifconfig tun0 | grep inet | cut -d ' ' -f 2 |
redfox 回复于:2003-05-21 10:19:16 |
有很多行的,哥哥,只能用我的赛~ ![]() |
redfox 回复于:2003-05-19 18:10:43 |
我是这么得到的
lastip=`ifconfig | grep '>' | tail -n 1 | awk '{print $2}'` |
zkinsz 回复于:2003-05-20 09:18:29 |
谢谢redfox,执行到
if [ "$2" != "$ip" ]; 时提示:[!=202.00.100.100]: not found 该怎样修改呢? |
zkinsz 回复于:2003-05-20 18:10:52 |
终于找到原因了,是笔误:
[的后面和]符号的前面要有一个空格. |
zkinsz 回复于:2003-05-21 00:07:49 |
ifconfig ppp0 | grep inet | cut -d : -f 2 | cut -d ' ' -f 1
无结果, ifconfig查看,TUN0上的才是动态取得的IP PPP0上并没有IP。 谢谢了。 |
xwings 回复于:2003-05-20 23:48:38 |
ifconfig ppp0 | grep inet | cut -d : -f 2 | cut -d ' ' -f 1
this one ? |