zentara <[EMAIL PROTECTED]> writes:
> On Tue, 02 Mar 2004 18:07:58 -0600, [EMAIL PROTECTED] (Harry Putnam)
> wrote:
>>
>>For some reason the pid printed does not match the output of ps:
>>
>>actual sample script"
>>
>>Note the script outputs 15173 and ps shows 30335
>>
>>Do you have an idea what i
Harry Putnam wrote:
>
> "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 ;
> > close DUMP or die "Cannot close pipe from tcpdump:
"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 ;
> close DUMP or die "Cannot close pipe from tcpdump: $!";
> close FILE;
>
> print "Pid was
Harry Putnam wrote:
>
> What is the handy way to record the pid of $some_process in this
> fake code?
>
> $some_process = 'tcpdump -v -ieth0 >file')
> system("$some_process") or die "Can't start $some_process: $!";
system() returns false on success and true on failure so "or die ..."
will execut
"Hanson, Rob" <[EMAIL PROTECTED]> writes:
> I'm not sure, probably by forking and execing. It won't return the result
> code from the other program though.
>
>
> $some_process = 'tcpdump -v -ieth0 >file';
>
> my $pid = fork();
> unless ($pid) {
> exec($some_process);
> die "Can't start $some_
On Tue, 2 Mar 2004, Harry Putnam wrote:
>
> What is the handy way to record the pid of $some_process in this
> fake code?
>
> $some_process = 'tcpdump -v -ieth0 >file')
> system("$some_process") or die "Can't start $some_process: $!";
>
> print "Pid is $pid\n";
>
> The process is started by a
I'm not sure, probably by forking and execing. It won't return the result
code from the other program though.
$some_process = 'tcpdump -v -ieth0 >file';
my $pid = fork();
unless ($pid) {
exec($some_process);
die "Can't start $some_process: $!";
}
print "Pid is $pid\n";
-Original Mess