I wrote a autoinstallation tool in perl on linux.
While I install this package maunally, I see this message:
So in my code, I did this:
But, when I run this code, the output looks like this:
How can I catch '[100%]' in the output?
Thanks for your help.
While I install this package maunally, I see this message:
Code:
% rpm -ivh mypackage.rpm
Preparing... ########################################### [COLOR=red][b][100%][/b][/color]
......
......
So in my code, I did this:
Code:
my $ret = `rpm -ivh mypackage.rpm`;
my @tmp = split(/\n/, $ret);
print "[COLOR=red][b]**[/b][/color]$tmp[0][COLOR=red][b]**[/b][/color]\n";
But, when I run this code, the output looks like this:
Code:
[COLOR=red][b]**[/b][/color]Preparing... ##################################################[COLOR=red][b]**[/b][/color]
How can I catch '[100%]' in the output?
Thanks for your help.