M
Madhusudan Singh
Hi
I am kind of new to perl (dabbled in it a little bit 4-5 years ago, but
never needed it till now - I am writing an application).
I need to extract some info from /sbin/iwconfig eth1 :
$ /sbin/iwconfig eth1 | grep "Link"
Link Quality:90/92 Signal level:-8 dBm Noise level:-148 dBm
(updated)
I want to extract 90/92 from the stuff above. How do I code it ?
If it is possible to use awk to do the above ('{print $2}' yields
"Quality:90/92", when I need to extract 90/92 or even better 90 and 92
separately, that is also ok.
How does one embed an awk command in perl ? I tried :
$info=`/sbin/iwconfig eth1 | grep "Link" | awk '{print $2}'`; but it did
not work (just reproduced o/p as if the second pipe were not even present).
Thanks.
I am kind of new to perl (dabbled in it a little bit 4-5 years ago, but
never needed it till now - I am writing an application).
I need to extract some info from /sbin/iwconfig eth1 :
$ /sbin/iwconfig eth1 | grep "Link"
Link Quality:90/92 Signal level:-8 dBm Noise level:-148 dBm
(updated)
I want to extract 90/92 from the stuff above. How do I code it ?
If it is possible to use awk to do the above ('{print $2}' yields
"Quality:90/92", when I need to extract 90/92 or even better 90 and 92
separately, that is also ok.
How does one embed an awk command in perl ? I tried :
$info=`/sbin/iwconfig eth1 | grep "Link" | awk '{print $2}'`; but it did
not work (just reproduced o/p as if the second pipe were not even present).
Thanks.