REQ: please me. "get data from line in Perl under Linux" TIA
am 09.05.2005 19:06:00 von John
please help to get the number of the following example line:
RX bytes:55313 (54.0 Kb) TX bytes:55313 (54.0 Kb)
i could filter this line from the ifconfig command, but how can i get
the bytes, "55313", from the line?
many thanx in advance
john
Re: REQ: please me. "get data from line in Perl under Linux" TIA
am 09.05.2005 19:40:12 von Gunnar Hjalmarsson
john wrote:
> please help to get the number of the following example line:
>
> RX bytes:55313 (54.0 Kb) TX bytes:55313 (54.0 Kb)
>
> i could filter this line from the ifconfig command, but how can i get
> the bytes, "55313", from the line?
Extract them by help of the m// operator.
perldoc perlop (where the m// operator is described)
perldoc perlretut (where you find more about regular expressions
in general including more extracting examples)
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl