Re: kill process when file number reached...
- From: Jenda@xxxxxxxxxxx (Jenda Krynicky)
- Date: Wed, 09 Jul 2008 00:38:42 +0200
From: onlineviewer <lancerset@xxxxxxxxx>
On Jul 1, 9:02 pm, Je...@xxxxxxxxxxx (Jenda Krynicky) wrote:
From: onlineviewer <lancer...@xxxxxxxxx>
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;
The system() doesn't return until the tcpdump exits.
You probably want to fork() and exec() instead. Or use
system 1, "tcpdump -i bge1 -s0 -w /tmp/file.out -C 1";
"system(1, @args) spawns an external process and immediately returns
its process designator, without waiting for it to terminate. Return
value may be used subsequently in wait or waitpid. Failure to spawn()
a subprocess is indicated by setting $? to "255 << 8". $? is set in a
way compatible with Unix (i.e. the exitstatus of the subprocess is
obtained by "$? >> 8", as described in the documentation). "
thanks, for the info, although im not really sure how to implement
this into my code.
can you show me how that would be inserted ?
Change
system "tcpdump -i bge1 -s0 -w /tmp/file.out -C 1";
to
system 1, "tcpdump -i bge1 -s0 -w /tmp/file.out -C 1";
Jenda
===== Jenda@xxxxxxxxxxx === http://Jenda.Krynicky.cz =====
When it comes to wine, women and song, wizards are allowed
to get drunk and croon as much as they like.
-- Terry Pratchett in Sourcery
.
- References:
- kill process when file number reached...
- From: Onlineviewer
- Re: kill process when file number reached...
- From: Onlineviewer
- kill process when file number reached...
- Prev by Date: Re: Perl Audit Reports
- Next by Date: Re: Debug Help Please
- Previous by thread: Re: kill process when file number reached...
- Next by thread: Max range of rand function?
- Index(es):