in reply to Passing the contents of a file in a "system" call to a .ksh script
my $log; ## Oops! Need this line, so $log is scoped beyond the {} my $LOGTIME = ... my @emails = qw(brother@elwood.com sister@elwood.com); my $LOGFILE = "/home/admin/logs/check_jvm/check_jvm_$LOGTIME.log"; open(LOG,"$LOGFILE") or die; { undef $/; $log = <LOG>; } close LOG; if (open(SENDMAIL, "|/usr/lib/sendmail -oi -t -odq")) { print SENDMAIL "From: PROD\@elwood.com\n" . "To: " . join(" ", @emails) . "\n" . "Subject: Web Server Issue\n" . "$log\n"; close(SENDMAIL); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Passing the contents of a file in a "system" call to a .ksh script
by BrotherElwood (Initiate) on Jan 08, 2009 at 20:20 UTC | |
by hbm (Hermit) on Jan 08, 2009 at 21:29 UTC |