[Perl] brainstorming with pipes & commands
Hi all !
I have something like that : open(FH,"command1 | command2 | command3 |"); These three commands must run together. *command1 send on stdout a stream that command2 and command3 process *BUT command1 send a progress in % on stderr and I MUST get it. ( I can't run command1 separately => creating a 5Go file !!! ) HOW CAN I DO THAT ???? ->doing an: open(FH,"command1 2>error.txt | command2 | command3 |"); and reading+processing error.txt ? ->CAN PERL DO SOMETHING LIKE THIS ? ## wrong code !! 1) open(PIPE); 2) open(FH,"command1 2>PIPE | command2 | command3 |"); 3) while(<PIPE>) { process the stderr } Well, I've been searching for 2 days but I can't find anything suitable. Have an idea of something equivalent ????? BIG THANX for your answers !! ;o)= Patator da FiRsT |
Welcome to LQ.
Can't you just read in from <STDER>? |
Try IPC::Open3. (perldoc IPC::Open3) I think it's installed by default, could be wrong.
I don't think that reading from <STDERR> is going to work. |
BIG THANX aluser !!!!
IPC::Open3 does a wonderfull job !!!!! ;o)= That's so easy now !!! THANX All ! Patator da FiRsT |
All times are GMT -5. The time now is 11:29 AM. |