On Thu, 28 Jun 2001, Ronald J. Yacketta wrote:

> Folks,
> 
> to make a long story short I have a req to-do the following. 1) gather
> continues data from netstat -I hme0 $SLEEPTIME > $netstatTMPFILE &
> while still parsing other information/data etc..
> 
> that is, the script needs to be bale to collect the netstat data while
> it is running other process, not just fork netstat and wait for it to
> die/return. it will never die/return unless it is killed.

Try something like this:

open NETSTAT, "netstat -I hme0 $SLEEPTIME |" or die "Can't start netstat: $!\n";

Then, just read from the NETSTAT filehandle.

For more information, look at 'open' and 'sysopen' in the Camel book.  
Also, you may want to consider using 'select' if you don't want to block
on reads.  (Be sure you look at the 'ready file descriptors' version of
'select').


- D

<[EMAIL PROTECTED]>

Reply via email to