Solved

Help in getting a perl script to run

Posted on 2004-10-03
62
247 Views
Last Modified: 2012-05-05
Hi,

If you know Perl can you help me figure out what I need to do to get this script to run?
Please only respond if you know Perl and you know what needs to be changed to get it running.

The errors I am getting are:
syntax error at C:\Batch\rumplekill.pl line 15, near "<"
syntax error at C:\Batch\rumplekill.pl line 15, near "&gt"

The script I am having a problem with is:
#!/usr/bin/perl

#rumplekiller.pl: something to attempt fending off
#Rumplestiltskin spam attacks. by bignosebird.com 2001

use Socket;
use CLI;

$myip="xx.xx.xx.xx";
$blackhole="192.168.1.252";
$blockedfile="C:\Communigate Files\blockedips.txt";
$tolerate=15;

 open(IX,"/usr/bin/tail -1000 /var/log/maillog |");
 while ($line=<IX>){
   chop $line;
   $line=~s/\://g;
   $line=~s/\<//g;
   $line=~s/\>//g;
   @parts=split(/\s+/,$line);
   if ($line=~/User unknown/i){
     $id=$parts[5];
     if ($results{$id} eq ""){
      push(@final,$parts[5]);
      $results{$id}=1;
     }
      else{
      $results{$id}=$results{$id} + 1;
      }
   }
 }
 close(IX);

 foreach $item (@final){
   if ($results{$item} > $tolerate){
    $killer=`/bin/grep '$item' /var/log/maillog | grep -i 'from=' `;
    chop $killer;
    $killer=~s/\]//g;
    @parts=split(/\[/,$killer);
    if ( defined(inet_aton($parts[2])) ){
     &kill_ip($parts[2]);
    }
  }
}

sub kill_ip{
my ($ip) = @_;
 @subparts=split(/\s+/,$ip);
 $ip=$subparts[0];
 open (LX,"<$blockedfile");
 while ($bl=<LX>){
   chop $bl;
   if ($bl eq $ip){
     return;
   }
 }
 @subparts=split(/\s+/,$ip);
 $newip=$subparts[0];
 open(OX,">>$blockedfile");
 print OX "$ip\n";
 close(OX);
 if ($ip ne "127.0.0.1" && $ip ne $myip){
#   system("/sbin/route -n add -host $ip gw $blackhole");
# }
#   Above line replaced to interact with Communigate
#   Below 11 lines added to interact with Communigate.
    {
        $cli = new CGP::CLI
        ( {
                PeerAddr=>"mydomain.com",
                PeerPort=>106,
                login=>"postmaster",
                password=>"password"
        })  ||  die "Can't login to CGPro: ".$CGP::ERR STRING."\n";

        $cli->SetBlacklistedIPs($cli ->GetBlacklistedIPs(), $ip );
    }
}

This is being run in XP Pro.
Perl is in:  C:\Perl
0
Comment
Question by:docfxit
  • 34
  • 26
62 Comments
 
LVL 84

Accepted Solution

by:
ozo earned 125 total points
Comment Utility
replace %lt; with < and %gt; with >
0
 
LVL 84

Expert Comment

by:ozo
Comment Utility
Also replace
"C:\Communigate Files\blockedips.txt"
with
"C:/Communigate Files/blockedips.txt"
or
'C:\Communigate Files\blockedips.txt'
0
 

Author Comment

by:docfxit
Comment Utility
Thanks Ozo,

That worked great.  The next error is:

Operator or semicolon missing before &amp at C:\Batch\rumplekill.pl line 62.
Ambiguous use of & resolved as operator & at C:\Batch\rumplekill.pl line 62.
syntax error at C:\Batch\rumplekill.pl line 62, near "amp;"
syntax error at C:\Batch\rumplekill.pl line 62, near "$myip)"

Is there some place I could go to learn Perl?
0
 
LVL 84

Expert Comment

by:ozo
Comment Utility
Also replace &amp; with &

You may also need to find substitutes for
/usr/bin/tail
and
/bin/grep
in XP Pro

the space in
$CGP::ERR STRING
also looks suspicious
0
 

Author Comment

by:docfxit
Comment Utility
Thanks Ozo,

I have grep loaded on this PC.  I'm not sure about tail but it's not giving me an error yet.

The next error is :

Missing right curly or square bracket at C:\Batch\rumplekill.pl line 88, at end
of line
syntax error at C:\Batch\rumplekill.pl line 88, at EOF
0
 
LVL 84

Expert Comment

by:ozo
Comment Utility
#   system("/sbin/route -n add -host $ip gw $blackhole");
# }
#   Above line replaced to interact with Communigate
comments out the } which matches the { in
 if ($ip ne "127.0.0.1" && $ip ne $myip){
It's not obvious whether or not the { on the following line was meant to replace the { in
 if ($ip ne "127.0.0.1" && $ip ne $myip){
0
 
LVL 84

Expert Comment

by:ozo
Comment Utility
0
 

Author Comment

by:docfxit
Comment Utility
You are good.  Thanks.

The next error I am getting is:

The system cannot find the path specified.

I have no idea which path it can't find.
0
 
LVL 84

Expert Comment

by:ozo
Comment Utility
It looks like you should comment out either the
 if ($ip ne "127.0.0.1" && $ip ne $myip){
line, or the following
  {
line
0
 

Author Comment

by:docfxit
Comment Utility
I did change one line from:
 open(IX,"/usr/bin/tail -1000 /var/log/maillog |");

To:
 open(IX,"/usr/bin/tail -1000 C:\Program Files\Communigate Modified Files\SystemLogs |");


Maybe that's the problem?
0
 
LVL 84

Expert Comment

by:ozo
Comment Utility
Try
 open(IX,'/usr/bin/tail -1000 C:\Program Files\Communigate Modified Files\SystemLogs |');
0
 

Author Comment

by:docfxit
Comment Utility
That gives me:

Bareword found where operator expected at C:\Batch\rumplekill.pl line 15, near "
'/usr/bin/tail -1000 'C"
        (Missing operator before C?)
Backslash found where operator expected at C:\Batch\rumplekill.pl line 15, near
"Files\"
syntax error at C:\Batch\rumplekill.pl line 15, near "'/usr/bin/tail -1000 'C"
0
 

Author Comment

by:docfxit
Comment Utility
Scratch that last error.

It's still the same error as before

The system cannot find the path specified.
0
 

Author Comment

by:docfxit
Comment Utility
I added print statements to try to figure out where the problem is.  I also fixed some more < and > .  It now looks like this:

#!/usr/bin/perl

#rumplekiller.pl: something to attempt fending off
#Rumplestiltskin spam attacks. by bignosebird.com 2001

use Socket;
use CLI;

$myip="xx.xx.xx.xx";
$blackhole="192.168.1.252";
$blockedfile='C:\Communigate Files\blockedips.txt';
$tolerate=15;

print '1';
 open(IX,'/usr/bin/tail -1000 C:\Program Files\CommuniGate Modified Files\SystemLogs |');
  while ($line=<IX>){
   chop $line;
   $line=~s/\://g;
   $line=~s/\<//g;
   $line=~s/\>//g;
   @parts=split(/\s+/,$line);
   if ($line=~/User unknown/i){
     $id=$parts[5];
     if ($results{$id} eq ""){
      push(@final,$parts[5]);
      $results{$id}=1;
     }
      else{
      $results{$id}=$results{$id} + 1;
      }
   }
 }
 close(IX);
print '2';
 foreach $item (@final){
   if ($results{$item} > $tolerate){
    $killer=`/bin/grep '$item' C:\Program Files\Communigate Modified Files\SystemLogs | grep -i 'from=' `;
    chop $killer;
    $killer=~s/\]//g;
    @parts=split(/\[/,$killer);
    if ( defined(inet_aton($parts[2])) ){
     &amp;kill_ip($parts[2]);
    }
  }
}

sub kill_ip{
my ($ip) = @_;
 @subparts=split(/\s+/,$ip);
 $ip=$subparts[0];
 open (LX,"<$blockedfile");
 while ($bl=<LX>){
   chop $bl;
   if ($bl eq $ip){
     return;
   }
 }
 @subparts=split(/\s+/,$ip);
 $newip=$subparts[0];
 open(OX,">>$blockedfile");
 print OX "$ip\n";
 close(OX);
 if ($ip ne "127.0.0.1" && $ip ne $myip){
#   system("/sbin/route -n add -host $ip gw $blackhole");
# }
#   Above line replaced to interact with Communigate
#   Below 11 lines added to interact with Communigate.
#    {
        $cli = new CGP::CLI
        ( {
                PeerAddr=>"mydomain.com",
                PeerPort=>106,
                login=>"postmaster",
                password=>"password"
        })  ||  die "Can't login to CGPro: ".$CGP::ERRSTRING."\n";

        $cli->SetBlacklistedIPs($cli ->GetBlacklistedIPs(), $ip );
    }
}
0
 

Author Comment

by:docfxit
Comment Utility
When I run it I get:

1The system cannot find the path specified.
2

So I know for sure it is having a problem with that line.
0
 
LVL 84

Expert Comment

by:ozo
Comment Utility
Do you have /usr/bin/tail?
0
 

Author Comment

by:docfxit
Comment Utility
I'm not sure.   Would that be inside of the Perl directory?   Or some where else?
0
 

Author Comment

by:docfxit
Comment Utility
Maybe it would help if I let you know what is in the directory?

In the directory C:\Program Files\CommuniGate Modified Files\SystemLogs

2004-09-27.log
2004-09-27_11-33.log
2004-09-27_22-10.log
2004-09-28.log
2004-09-28_15-15.log
2004-09-29.log
2004-09-29_08-44.log
2004-09-29_12-46.log
2004-09-29_15-18.log
2004-09-29_17-36.log
2004-09-29_20-11.log
2004-09-29_22-46.log
2004-09-30.log
2004-09-30_04-42.log
2004-09-30_06-55.log
2004-09-30_08-43.log
2004-09-30_09-39.log
2004-09-30_12-46.log
2004-09-30_16-15.log
2004-09-30_19-02.log
2004-09-30_19-37.log
2004-09-30_22-12.log
2004-10-01.log
2004-10-01_01-22.log
2004-10-01_03-12.log
2004-10-01_04-05.log
2004-10-01_05-37.log
2004-10-01_06-38.log
2004-10-01_08-27.log
2004-10-01_12-24.log
2004-10-01_15-32.log
2004-10-01_19-53.log
2004-10-01_20-50.log
2004-10-02.log
2004-10-02_03-00.log
2004-10-02_04-21.log
2004-10-02_06-02.log
2004-10-02_06-31.log
2004-10-02_06-50.log
2004-10-02_07-34.log
2004-10-02_08-06.log
2004-10-02_08-17.log
2004-10-02_09-25.log
2004-10-02_10-25.log
2004-10-02_10-38.log
2004-10-02_11-53.log
2004-10-02_13-38.log
2004-10-02_13-41.log
2004-10-02_13-46.log
2004-10-02_13-50.log
2004-10-02_13-55.log
2004-10-02_13-59.log
2004-10-02_14-10.log
2004-10-02_18-04.log
2004-10-02_20-14.log
2004-10-02_21-54.log
2004-10-03.log
2004-10-03_02-17.log
2004-10-03_03-23.log
2004-10-03_04-28.log
2004-10-03_07-02.log
2004-10-03_09-03.log
2004-10-03_11-21.log
2004-10-03_16-28.log
2004-10-03_19-42.log
2004-10-03_21-49.log
2004-10-04.log
0
 
LVL 84

Expert Comment

by:ozo
Comment Utility
tail is a unix program that displays the last n lines of its input.
If you don't have it  in XP Pro, you might try something like

open(IX,'<C:/Program Files/CommuniGate Modified Files/SystemLogs') or die "Can't open C:/Program Files/CommuniGate Modified Files/SystemLogs $!";
  foreach $line ( (<IX>)[-100..-1] ){
0
 

Author Comment

by:docfxit
Comment Utility
I found tail here
http://search.cpan.org/~cwest/ppt-0.14/src/tail/tail.thierry

If you could let me know where to put it and what the correct extension should be I should be able to get it running.

Thanks
0
 

Author Comment

by:docfxit
Comment Utility
I saved it as:
Tail.pl
in:
c:\Perl\bin

I still get the same error.
0
 

Author Comment

by:docfxit
Comment Utility
I commented out:

# open(IX,'/usr/bin/tail -1000 C:\Program Files\CommuniGate Modified Files\SystemLogs |');

I added:
open(IX,'<C:/Program Files/CommuniGate Modified Files/SystemLogs') or die "Can't open C:/Program Files/CommuniGate Modified Files/SystemLogs $!";
  foreach $line ( (<IX>)[-100..-1] ){

And I added } at line 91

I am now getting :

Can't open C:/Program Files/CommuniGate Modified Files/SystemLogs Permission den
ied at C:\Batch\rumplekill.pl line 16.
0
 
LVL 84

Expert Comment

by:ozo
Comment Utility
Is your file C:/Program Files/CommuniGate Modified Files/SystemLogs readable?
0
 

Author Comment

by:docfxit
Comment Utility
That is the path.

The files are in
C:/Program Files/CommuniGate Modified Files/SystemLogs/*.*

The files are listed above.
0
 
LVL 84

Expert Comment

by:ozo
Comment Utility
#open wants a filename, like
open IX,"<C:/Program Files/CommuniGate Modified Files/SystemLogs/2004-09-27.log"
0
 
LVL 84

Expert Comment

by:ozo
Comment Utility
if you want to do it for all files, you can put a loop around it:

for( <C:/Program Files/CommuniGate Modified Files/SystemLogs/*.*> ){
    open IX,"<$_" or die "Can't open $_ $!";
    foreach $line ( (<IX>)[-100..-1] ){
        chop $line;
       ...
    }
    close IX;
}
0
 

Author Comment

by:docfxit
Comment Utility
I entered one file.  The file I will want is  actually going to be the last file.  (The current file for today)

It ran.  The output I got is:

12222222222222222222222222222222222222222222222222222222222222222222222222222222
222222222222222222222

Which means it was printing my debug print lines.  But it didn't do what it was supposed to.  It didn't write out the file or update the blacklist.
0
 

Author Comment

by:docfxit
Comment Utility
I added some more print statements to try to figure out where it is going wrong.  The script now looks like this:

#!/usr/bin/perl

#rumplekiller.pl: something to attempt fending off
#Rumplestiltskin spam attacks. by bignosebird.com 2001

use Socket;
use CLI;

$myip="xx.xx.xx.xx";
$blackhole="192.168.1.252";
$blockedfile='C:\Communigate Files\blockedips.txt';
$tolerate=15;

print '1';
# open(IX,'/usr/bin/tail -1000 C:\Program Files\CommuniGate Modified Files\SystemLogs |');
open(IX,'<C:/Program Files/CommuniGate Modified Files/SystemLogs/2004-10-04_01-05.log') or die "Can't open C:/Program Files/CommuniGate Modified Files/SystemLogs $!";
  foreach $line ( (<IX>)[-100..-1] ){
  while ($line=<IX>){
   chop $line;
   $line=~s/\://g;
   $line=~s/\<//g;
   $line=~s/\>//g;
   @parts=split(/\s+/,$line);
   if ($line=~/User unknown/i){
     $id=$parts[5];
     if ($results{$id} eq ""){
      push(@final,$parts[5]);
      $results{$id}=1;
     }
      else{
      $results{$id}=$results{$id} + 1;
      }
   }
 }
 close(IX);
print '2';
 foreach $item (@final){
   if ($results{$item} > $tolerate){
    $killer=`/bin/grep '$item' C:\Program Files\Communigate Modified Files\SystemLogs | grep -i 'from=' `;
    chop $killer;
    $killer=~s/\]//g;
    @parts=split(/\[/,$killer);
    if ( defined(inet_aton($parts[2])) ){
     &amp;kill_ip($parts[2]);
    }
  }
}
print '3';
sub kill_ip{
my ($ip) = @_;
 @subparts=split(/\s+/,$ip);
 $ip=$subparts[0];
print '4';
 open (LX,"<$blockedfile");
 while ($bl=<LX>){
   chop $bl;
    if ($bl eq $ip){
     return;
   }
 }
 @subparts=split(/\s+/,$ip);
 $newip=$subparts[0];
 print '5';
 open(OX,">>$blockedfile");
 print OX "$ip\n";
 close(OX);
 if ($ip ne "127.0.0.1" && $ip ne $myip){
#   system("/sbin/route -n add -host $ip gw $blackhole");
# }
#   Above line replaced to interact with Communigate
#   Below 11 lines added to interact with Communigate.
#    {
 print '6';
        $cli = new CGP::CLI
        ( {
                PeerAddr=>"mydomain.com",
                PeerPort=>106,
                login=>"postmaster",
                password=>"password"
        })  ||  die "Can't login to CGPro: ".$CGP::ERRSTRING."\n";

        $cli->SetBlacklistedIPs($cli ->GetBlacklistedIPs(), $ip );
    }
}
}
0
 

Author Comment

by:docfxit
Comment Utility
When I run it I get:

12323232323232323232323232323232323232323232323232323232323232323232323232323232
32323232323232323232323232323232323232323232323232323232323232323232323232323232
32323232323232323232323232323232323232323

So it never gets to my Print '4' statement.

Any ideas?
0
 
LVL 84

Expert Comment

by:ozo
Comment Utility
the
 foreach $line ( (<IX>)[-100..-1] ){
line was meant to replace the
 while ($line=<IX>){
line
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:docfxit
Comment Utility
Thanks.  Silly me.  Thanks for catching that.

Now when I run it the output I get is:

123

The file blockedfile never gets written out and the blackhole list is not updated.
0
 
LVL 84

Expert Comment

by:ozo
Comment Utility
The print '4'; is in the sub kill_ip
which is called from
   &kill_ip($parts[2]);
which is in the loop
 foreach $item (@final){
Does @final contain what you expect?
0
 
LVL 84

Expert Comment

by:ozo
Comment Utility
do you have /bin/grep? or does your grep live someplace else?
0
 

Author Comment

by:docfxit
Comment Utility
I have Grep in:

C:\Program Files\Grep

How can I print @final so I can see what it has?
0
 
LVL 84

Expert Comment

by:ozo
Comment Utility
You might need to replace the statement
$killer=`/bin/grep '$item' C:\Program Files\Communigate Modified Files\SystemLogs | grep -i 'from=' `;
with something like
open G,"<C:/Program Files/Communigate Modified Files/SystemLogs/2004-10-04_01-05.log" or die "Can't open C:/Program Files/Communigate Modified Files/SystemLogs/2004-10-04_01-05.log $!";
$killer=join'',grep{/$item/&&/from=/i}<G>;
close G;
0
 

Author Comment

by:docfxit
Comment Utility
I changed the line from:
    $killer=`/bin/grep '$item' C:\Program Files\Communigate Modified Files\SystemLogs | grep -i 'from=' `;
 To:
   $killer=`C:/Program Files/grep '$item' C:\Program Files\Communigate Modified Files\SystemLogs/2004-10-04_01-05.log | grep -i 'from=' `;
 
0
 
LVL 84

Expert Comment

by:ozo
Comment Utility
print @final;
0
 

Author Comment

by:docfxit
Comment Utility
I change it like you suggested.

Still nothing comes out

I added the Print @final;

Nothing came out.
0
 

Author Comment

by:docfxit
Comment Utility
Boy.  I sure didn't know this was going to be so hard.  I thought I started with a working script.
0
 
LVL 84

Expert Comment

by:ozo
Comment Utility
$killer=`C:/Program Files/grep '$item' C:\Program Files\Communigate Modified Files\SystemLogs/2004-10-04_01-05.log | grep -i 'from=' `;
may have to be
$killer=`C:\\Program Files\\grep "$item" C:\\Program Files\\Communigate Modified Files\\SystemLogs\\2004-10-04_01-05.log | C:\\Program Files\\grep -i 'from=' `;
0
 
LVL 84

Expert Comment

by:ozo
Comment Utility
You might want to print "$line\n"; and print "$id\n"; to see if you are getting the right values
0
 

Author Comment

by:docfxit
Comment Utility
I discovered it was looking for:
 User unknown
I didn't find that in the log.
I change it from :
 if ($line=~/User unknown/i){
TO:
   if ($line=~/illegal name for an account/i){
I am now getting something to come out in @final
I don't understand enough perl to know what it's doing after it gets @final
0
 
LVL 84

Expert Comment

by:ozo
Comment Utility
$killer=`C:\\Program Files\\grep "$item" C:\\Program Files\\Communigate Modified Files\\SystemLogs\\2004-10-04_01-05.log | C:\\Program Files\\grep -i "from=" `;
0
 
LVL 84

Expert Comment

by:ozo
Comment Utility
There may be other format differences between /var/log/maillog and C:/Program Files/CommuniGate Modified Files/SystemLogs/2004-10-04_01-05.log
@parts=split(/\s+/,$line);
$id=$parts[5];
gets the sixth space delimited field of $line
Is the equivalent field in your log file the same?
0
 

Author Comment

by:docfxit
Comment Utility
I tried  that.

Of coarse I removed the Open line down to the close.

I got a new error:
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
4'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
43
0
 

Author Comment

by:docfxit
Comment Utility
In @final it's getting the username@domain.com  so I think $id=$parts[5] is correct.
0
 

Author Comment

by:docfxit
Comment Utility
With the Open through Close instead of the $Killer line I get the entries in @final then
443

It writes out the blockedips.txt file now but it only has 2 bytes in it.
0
 
LVL 84

Expert Comment

by:ozo
Comment Utility
You may have to quote the spaces in the file names:
"C:\\Program Files\\grep" "$item" "C:\\Program Files\\Communigate Modified Files\\SystemLogs\\2004-10-04_01-05.log" | "C:\\Program Files\\grep" -i "from=" `
0
 

Author Comment

by:docfxit
Comment Utility
Now I am getting an error saying

Can't login to CGPro: Can't open connection to CGPro Server
final=byrejectedgray@mydomain.comgill@mydomain.comgolden@mydomain.comgoff
omgonzales@mydomain.comhorne@mydomain.comhoward@mydomain.comhuff@mydomain.
com456
0
 
LVL 84

Expert Comment

by:ozo
Comment Utility
#does
open G,"<C:/Program Files/Communigate Modified Files/SystemLogs/2004-10-04_01-05.log" or die "Can't open C:/Program Files/Communigate Modified Files/SystemLogs/2004-10-04_01-05.log $!";
$killer=join'',grep{/$item/&&/from=/i}<G>;
close G;
print "$killer\n";
#print the right value for $killer?
0
 

Author Comment

by:docfxit
Comment Utility
I don't think it liked that:

Results:
String found where operator expected at C:\Batch\rumplekill.pl line 48, near ""C
:\\Program Files\\grep" "$item""
        (Missing operator before  "$item"?)
String found where operator expected at C:\Batch\rumplekill.pl line 48, near ""$
item" "C:\\Program Files\\Communigate Modified Files\\SystemLogs\\2004-10-04_01-
05.log""
        (Missing operator before  "C:\\Program Files\\Communigate Modified Files
\\SystemLogs\\2004-10-04_01-05.log"?)
String found where operator expected at C:\Batch\rumplekill.pl line 48, near "i
"from=""
        (Do you need to predeclare i?)
Backticks found where operator expected at C:\Batch\rumplekill.pl line 48, at en
d of line
        (Missing semicolon on previous line?)
syntax error at C:\Batch\rumplekill.pl line 48, near ""C:\\Program Files\\grep"
"$item""
Can't find string terminator "`" anywhere before EOF at C:\Batch\rumplekill.pl l
ine 48.
0
 
LVL 84

Expert Comment

by:ozo
Comment Utility
PeerAddr=>"mydomain.com", #may be just an example not be the actual domain name you need
0
 
LVL 84

Expert Comment

by:ozo
Comment Utility
$killer=`"C:\\Program Files\\grep" "$item" "C:\\Program Files\\Communigate Modified Files\\SystemLogs\\2004-10-04_01-05.log" | "C:\\Program Files\\grep" -i "from=" `;
0
 

Author Comment

by:docfxit
Comment Utility
I think it is printing the correct value for killer.  Just like the last open did.

It can't open the connection to the server and at the end it's getting
456

But it still writing only 2 bytes to the file .
0
 

Author Comment

by:docfxit
Comment Utility
It is just an example.  I have my real domain in there.  I didn't want to publish it here.
0
 
LVL 84

Expert Comment

by:ozo
Comment Utility
I must leave soon, but I will be back in a few hours.
0
 

Author Comment

by:docfxit
Comment Utility
With:
$killer=`"C:\\Program Files\\grep" "$item" "C:\\Program Files\\Communigate Modified Files\\SystemLogs\\2004-10-04_01-05.log" | "C:\\Program Files\\grep" -i "from=" `;

I get :

'"C:\Program Files\grep"' is not recognized as an internal or external
 command,operable program or batch file.

4'"C:\Program Files\grep"' is not recognized as an internal or external command,
operable program or batch file.

43
0
 

Author Comment

by:docfxit
Comment Utility
What time is it there?  It's 3:43 am here.
0
 

Author Comment

by:docfxit
Comment Utility
I fixed the login problem.  I had to replace my actual doman name  with localhost.

At the end of the run it's coming out with:
456
43
0
 

Author Comment

by:docfxit
Comment Utility
Thank you very much for all your help.
You have been really great at figuring  this all out.

I am going to get some sleep now.
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (http://www.mongodb.org/downloads),  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now