output from shell cmd

J

jrwats

When executing some command via backticks like the following:

$strCmd = <<'HEREDOC';
someExecutable.exe -a -bunch -of -options
HEREDOC
`$strCmd`;

the only way to get output from the result is to do:

$result = `$strCmd`;
print $result;

Is there any way to get output from the command real-time? I don't
even need to save the results, I just want the output to go to stdout
as it would if I had run the command from a bash script.

Thanks,
JW
 
J

jrwats

Is there any way to get output from the command real-time?  I don't
even need to save the results, I just want the output to go to stdout
as it would if I had run the command from a bash script.

Looks like the system(@args) command is the answer to that question.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,818
Latest member
Brigette36

Latest Threads

Top