原帖由
ly5066113 于 2009-6-17 15:52 发表
try
awk 'ARGIND==1{n[$1]=$2}ARGIND==2{m[$1]=$2}ARGIND==3{print $0,n[$1],m[$2]}' name mem index
[root@localhost shell]# cat /tmp/index
0 112
1 16
2 320
3 336
4 48
5 80
6 96
[root@localhost shell]# cat /tmp/name
0 server1
1 server2
2 server3
3 server4
4 server5
5 server6
6 server7
[root@localhost shell]# cat /tmp/memtatol
16 262144
48 524288
80 262144
96 262144
112 262144
336 262144
[root@localhost shell]# cat /tmp/memused
16 70776
48 10484
80 34076
96 18348
112 20968
336 23592
[root@localhost shell]# cat /tmp/cpuused
16 139300
17 98012
48 89978
80 103676
96 92172
112 94314
336 102839