rduke15 has asked for the wisdom of the Perl Monks concerning the following question:
I would like to start a system command from a Perl script, but let it be an interactive bash session. Either in the same terminal window, or in a new window.
In this case, the process I want to start from Perl is an ffmpeg conversion. That can take quite a while, and I would like to see the progress ffmpeg prints out.
If I start it with system(), I don't see the output.
If I use backticks, I get the output only after it is finished. Until then, I would have no idea what is going on.
There is also exec(), but that would terminate my perl script.
Is there yet another alternative?
Basically, I'm trying to do this:
#!/usr/bin/perl my $options = '....'; my @files = @ARGV || <>; foreach my $file (@files) { my $outfile = "$file.mov"; #### SOMETHING( "ffmpeg -i '$file' $options '$outfile'" ); }
where "something()" would either start the command in the current terminal and wait for it to finish, or maybe start a new terminal window, and also wait for it to finish.
|
---|