On Fri, Sep 10, 2004 at 08:33:11PM +0200, I�aki wrote:
>  /sbin/ifconfig eth0 | grep 'RX byte' | awk '{print $7 $8}'
Soy un p�simo programador bash/awk... mi soluci�n est� basada en PERL:

/sbin/ifconfig eth0 | grep 'RX byte' | awk '{print $7 $8}'|perl -e
'$_=<STDIN>; s/[\(|\)]//g; print;'

eso te saca los par�ntesis del modo que quer�s. De todas formas para hacerlo
en PERL pero de un solo golpe:

/sbin/ifconfig eth0|perl -e '@_=<STDIN>; $_= $_[6]; split /[ ]+/; $_ = $_[3];
s/[\(|\)]//g; print'

>  58.2 MB
>  750.5 KB
>  1.2 GB

Complic�ndolo un poco m�s pod�s sacar otros valores... decime cu�les quer�s y
te hago un scriptecito m�s completo.

Saludos,

F�lix

-- 
Felix Cuello
[EMAIL PROTECTED]
- 1432 -

Q:      How do you know when you're in the <ethnic> section of Vermont?
A:      The maple sap buckets are hanging on utility poles.

Responder a