P
perlmbk
Hi,
I want to grep the alert message ( $msg ) for string patterns contained
in the file alertpager.txt, here is the code :
#!/usr/bin/perl
local $nmsg = $ENV{'NOTIFICATION_MSG'};
$nmsg = $ARGV[2] unless $nmsg;
local $matrixpager_file = "c:\\alertpager.txt";
open(MATRIXPAGER, $matrixpager_file);
local @content = <MATRIXPAGER>;
close(MATRIXPAGER);
foreach $ln (@content)
{
if ($ln = $msg) <----- want to grep the
"$ln" value here
{
# if success, echo hello
# else exit
}
I want to grep the alert message ( $msg ) for string patterns contained
in the file alertpager.txt, here is the code :
#!/usr/bin/perl
local $nmsg = $ENV{'NOTIFICATION_MSG'};
$nmsg = $ARGV[2] unless $nmsg;
local $matrixpager_file = "c:\\alertpager.txt";
open(MATRIXPAGER, $matrixpager_file);
local @content = <MATRIXPAGER>;
close(MATRIXPAGER);
foreach $ln (@content)
{
if ($ln = $msg) <----- want to grep the
"$ln" value here
{
# if success, echo hello
# else exit
}