I want to uninstall a package in Solaris, say NewPackage
. For that I am using the command:
pkgrm NewPackage
It will display all the steps in the STDOUT and at the end it will give the message that the package is uninstalled successfully.
If i want to uninstall the same package in a Perl program how do I redirect the STDOUT messages to a file so that at the end of the execution I can go to the file and verify the file. Presently i tried the following commands without success:
open (FD, "/usr/tmp/result.txt");
$input1 = <FD>;
$input2 = <FD>;
system("pkgrm NewPackage" < $input1);
But don't know how to pass the second input.
Please advice how to proceed.