Folks,
This is my code snippet. I am running a java process and forwarding the output onto a file.
$mycommand1 = "java -jar cmd.jar -job status -txnid $tid";
$tpid1 = open(OPNTXNPIPE, "$mycommand1 2>&1 |");
open (OUTPUTFILE,">out")
while($line = <OPNTXNPIPE> )
{
print OUTPUTFILE $line;
}
close (OUTPUTFILE);
My problem is that the output file "out" does not give me consistent results, it misses some of the lines from the output.
I get all the lines when the same java command is executed at the shell prompt.
This is my code snippet. I am running a java process and forwarding the output onto a file.
$mycommand1 = "java -jar cmd.jar -job status -txnid $tid";
$tpid1 = open(OPNTXNPIPE, "$mycommand1 2>&1 |");
open (OUTPUTFILE,">out")
while($line = <OPNTXNPIPE> )
{
print OUTPUTFILE $line;
}
close (OUTPUTFILE);
My problem is that the output file "out" does not give me consistent results, it misses some of the lines from the output.
I get all the lines when the same java command is executed at the shell prompt.