Solved

Help in getting a perl script to run

Posted on 2004-10-03
62
261 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
ID: 12214875
replace %lt; with < and %gt; with >
0
 
LVL 84

Expert Comment

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

Author Comment

by:docfxit
ID: 12214933
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
ID: 12214946
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
ID: 12214976
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
ID: 12214981
#   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
ID: 12214995
0
 

Author Comment

by:docfxit
ID: 12215005
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
ID: 12215010
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
ID: 12215027
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
ID: 12215095
Try
 open(IX,'/usr/bin/tail -1000 C:\Program Files\Communigate Modified Files\SystemLogs |');
0
 

Author Comment

by:docfxit
ID: 12215114
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
ID: 12215121
Scratch that last error.

It's still the same error as before

The system cannot find the path specified.
0
 

Author Comment

by:docfxit
ID: 12215130
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
ID: 12215137
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
ID: 12215144
Do you have /usr/bin/tail?
0
 

Author Comment

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

Author Comment

by:docfxit
ID: 12215175
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
ID: 12215273
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
ID: 12215275
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
ID: 12215325
I saved it as:
Tail.pl
in:
c:\Perl\bin

I still get the same error.
0
 

Author Comment

by:docfxit
ID: 12215334
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
ID: 12215355
Is your file C:/Program Files/CommuniGate Modified Files/SystemLogs readable?
0
 

Author Comment

by:docfxit
ID: 12215375
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
ID: 12215397
#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
ID: 12215406
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
ID: 12215466
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
ID: 12215485
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
ID: 12215491
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
ID: 12215503
the
 foreach $line ( (<IX>)[-100..-1] ){
line was meant to replace the
 while ($line=<IX>){
line
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:docfxit
ID: 12215517
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
ID: 12215523
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
ID: 12215538
do you have /bin/grep? or does your grep live someplace else?
0
 

Author Comment

by:docfxit
ID: 12215557
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
ID: 12215585
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
ID: 12215586
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
ID: 12215593
print @final;
0
 

Author Comment

by:docfxit
ID: 12215602
I change it like you suggested.

Still nothing comes out

I added the Print @final;

Nothing came out.
0
 

Author Comment

by:docfxit
ID: 12215607
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
ID: 12215623
$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
ID: 12215638
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
ID: 12215732
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
ID: 12215738
$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
ID: 12215765
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
ID: 12215766
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
ID: 12215779
In @final it's getting the username@domain.com  so I think $id=$parts[5] is correct.
0
 

Author Comment

by:docfxit
ID: 12215800
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
ID: 12215808
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
ID: 12215814
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
ID: 12215830
#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
ID: 12215839
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
ID: 12215846
PeerAddr=>"mydomain.com", #may be just an example not be the actual domain name you need
0
 
LVL 84

Expert Comment

by:ozo
ID: 12215862
$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
ID: 12215863
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
ID: 12215869
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
ID: 12215881
I must leave soon, but I will be back in a few hours.
0
 

Author Comment

by:docfxit
ID: 12215893
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
ID: 12215903
What time is it there?  It's 3:43 am here.
0
 

Author Comment

by:docfxit
ID: 12215944
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
ID: 12216096
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
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 is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

910 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

19 Experts available now in Live!

Get 1:1 Help Now