pomoc s rozparsovanim

Milan Cizek cizek.milan at seznam.cz
Tue Jun 24 20:58:25 CEST 2003


Ahoj,
nedari semi prijit na to, kde mam chybu... :-( Jakoby nefungovalo
posledni omezeni s awk, do jednotlivych promenych potrebuju ciselne
hodnoty. Dik za jakoukoli radu.

my $iface = 'wi0';

# get wireless link details
my $snr = `wicontrol $iface|grep "dBm Coms Quality"|awk '{print $5}'`;
my $signal = `wicontrol $iface|grep "dBm Coms Quality"|awk '{print
$6}'`;
my $noise = `wicontrol $iface|grep "dBm Coms Quality"|awk '{print $7}'`;
my $rate = `wicontrol $iface|grep "Tx rate (actual speed)"|awk '{print
$6}'`;

# remove eol chars
chomp($snr);
chomp($signal);
chomp($noise);
chomp($rate);

print "$iface link stats: snr: $snr dB, signal: $signal dBm, noise:
$noise dBm, rate: $rate Mbits/s\n";

Milan





More information about the Users-l mailing list