applying a regular expression on the continuous output of ping command

2007-05-16 Thread Srinivas
Hi, ping geekcrossing.net|perl -le m/time=(\d+)/;print $1; Can some one help me with the above command -srini -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: applying a regular expression on the continuous output of ping command

2007-05-16 Thread Chas Owens
On 5/16/07, Srinivainputs [EMAIL PROTECTED] wrote: Hi, ping geekcrossing.net|perl -le m/time=(\d+)/;print $1; Can some one help me with the above command Add an n to the perl arguments to get it loop over stdin and use single quotes to prevent shell from trying to interpolate $1. ping

Re: applying a regular expression on the continuous output of ping command

2007-05-16 Thread Goran
Something like this: ping geekcrossing.net | perl -nle 'print $1 if /time=(\d+\.\d+)/' HTH Goran -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/