"John W. Krahn" <[EMAIL PROTECTED]> writes: > open FILE, '>file' or die "Cannot open file: $!"; > my $pid = open DUMP, 'tcpdump -v -ieth0 |' or die "Cannot open pipe from > tcpdump: $!"; > print FILE while <DUMP>; > close DUMP or die "Cannot close pipe from tcpdump: $!"; > close FILE; > > print "Pid was $pid\n";
Looking at this, I'm guessing one doesn't get to know the pid until its all over. (I can't try it out right now). Which in this case would not be usefull. This thing needs to run until at the 4hr mark syslog sends a SIGHUP and rotates the ouput files. All that is taken care of by syslog. But the tcpdump process runs continuously. Only stopped by outside forces and then restarted. There is probably some standard way to put those pid numbers in /var/run but I don't know it. I thought perl could do it fairly easily but maybe not. I can always grep the ps output inside the script and get it that way. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>