in reply to Passing the contents of a file in a "system" call to a .ksh script
Update: Added call to chomp ... for, hopefully obvious reasons ;-)my ($LOGFILE, @content) = ("/home/admin/logs/check_jvm/check_jvm_$LOGT +IME.log"); open LOG, "<$LOGFILE" or die "open($LOGFILE) failed - $!"; chomp(@content = <LOG>); close LOG; my @args = ("/home/admin/bin/email.ksh", @content, "Web Server Issue", + "PROD", "/home/admin/logs/check_jvm/EmailAlert.log"); system(@args) == 0 or die "system @args failed: $?"
Thanx to fullermd - changed @LOG to @content & removed quotes (it's already in list context) in assignment of/to <c>@args>/c>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Passing the contents of a file in a "system" call to a .ksh script
by fullermd (Vicar) on Jan 09, 2009 at 03:15 UTC | |
by Bloodnok (Vicar) on Jan 09, 2009 at 10:41 UTC | |
by fullermd (Vicar) on Jan 09, 2009 at 11:41 UTC |