Hello All,

I am trying to run a tcpdump and have perl kill the tcpdump once 10
files have been created by the tcpdump. Here is my code, not sure...if
my logic is screwy
Thanks,

system "tcpdump -i bge1 -s0 -w /tmp/file.out -C 1";
sleep 2;

while(true){
        @array1 = `ls -l /tmp | grep files`;
        [EMAIL PROTECTED];

                if ($result > 3){
                        $x=`ps -ef | awk '/tcpdump/ && !/awk/ {print
$2}'`;
                        @y=split(' ', $x);
                        $c=$y[1];
                        system "kill -9 $c";
                        print "killing tcpdump...";
                }else{
                        print "!!!\n";
                        exit;
                }
exit;
}


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to