in reply to How do I whack the output of the shell command "exim -bp" into an array?
-------------------------------------------------- <FILENAME: Mailq_Check.pl> open(STDOUT, ">mailq_check.log"); system("mailq| grep frozen"); close STDOUT; exec(`perl mail_report.pl mailq_check.log`); -------------------------------------------------- <FILENAME: mail_report.pl> while (<>) { @array = $_; $mail_fault_cnt++;} if ($mail_fault_cnt>0) { exec (`more mailq_check.log| mail -s MailQ_Error sstock\@essex +.ac.uk`);}
Originally posted as a Categorized Answer.
|
|---|