- 论坛徽章:
- 0
|
本帖最后由 lmtwl 于 2014-06-24 19:40 编辑
回复 4# 关阴月飞
这样是不行的,我本意是获取 ip 和掩码 ,在同一行存储,上面执行后是,结果是分别存储了ip和掩码断。
我在bash中- root@testlog:~# bash --version
- GNU bash, version 4.2.25(1)-release (x86_64-pc-linux-gnu)
- Copyright (C) 2011 Free Software Foundation, Inc.
- License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
- This is free software; you are free to change and redistribute it.
- There is NO WARRANTY, to the extent permitted by law.
复制代码 中- arr=($(route -n |grep -v 0.0.0.0 |awk '{print $1,$3}' ))
- arr=$(route -n |grep -v 0.0.0.0 |awk '{print $1,$3}' )
复制代码 是没有任何区别的 |
|