Hi, I'm writing a script to edit the main.cf config file and I'm having this problem. (I'm on RedHat 9) At the end of the script I want to see if my changes work, and if postfix is happy. To do this, I would think that the following would be just fine:
$postfix_check = `postfix check`;
print ($postfix_check);
if($postfix_check =~ /fatal/) {
print "\nPostfix is broken\n";
}else{
print "\nPostfix file A OK\n";
}
The problem is: the output that postfix gives back goes straight to my screen not to the $postfix_check variable. How can I make the backtick catch all output?
$postfix_check = `postfix check`;
print ($postfix_check);
if($postfix_check =~ /fatal/) {
print "\nPostfix is broken\n";
}else{
print "\nPostfix file A OK\n";
}
The problem is: the output that postfix gives back goes straight to my screen not to the $postfix_check variable. How can I make the backtick catch all output?