|
Re: awk script help
Can anyone please help me with this awk script?
rsh sim1 vmstat -m | awk 'NR == 12 {print "Sim1","\t", $6}' >> /net/home/linux_users/Phyoe/scripts/man_u.txt && rup -l | egrep sim1 | awk '{print "\t","\t", $8}' >> /net/home/linux_users/Phyoe/scripts/man_u.txt
The above output will be Sim1 2981
1.08
I wish to get the output in one line as following Sim1 2981 1.08
and also how do i print the field immediately after the regex?
awk '/regexp/{getline;print}' <-this does not work for me as i need to print the field, not line.
Please Help
Best Regards,
Aung Phyoe
Last edited by Saosin1984 : 06-09-2008 at 11:46 PM.
|