tail -f | grep

whenever whatever at whoever.net
Sun Nov 19 20:50:03 PST 2000


Yes, it does.., did you changed the file location to fit your need?
perl location, the messages file location and finally your log file /location/name.   It works fine on a slackware system.

On Sun, Nov 19, 2000 at 03:53:30PM -1000, Mike Ballon wrote:
> No, did it work on your box?
> 
> ----- Original Message -----
> From: "whenever" <whatever at whoever.net>
> To: "Linux Users Anonymous" <luau at luau.hi.net>
> Sent: Friday, November 17, 2000 10:37 PM
> Subject: [luau] tail -f | grep
> 
> 
> > Does this work for you?, runnig it with nohup or & if you don't want it to
> die after logout.
> >
> > #!/usr/bin/perl
> > # ^^^^^ change to your perl location
> > #keep reading messages and log Sex.txt to your.log.file
> >
> > while (1) {
> > open LOG, '/var/adm/messages' || die "no can open file: $!";
> >
> > seek(LOG,0,2);
> > for(;;) {
> > headerloop: while(<LOG>)
> > {
> >         chomp;
> > # change the filter rule as needed
> >         if (/.*(Sex.txt).*/)
> >         {
> > # change next line to fit your file location
> >         open YOURLOG, '>> /some/where/your.log.file' || die "can not write
> to file";
> >         print YOURLOG "$_","\n";
> >         }
> >
> > }
> > sleep(1);
> > seek(LOG,0,1);
> > close YOURLOG;
> > }
> > }
> >
> > ---
> > You are currently subscribed to luau as: calzonie at hawaii.rr.com
> > To unsubscribe send a blank email to $subst('Email.Unsub')
> 
> 
> ---
> You are currently subscribed to luau as: whatever at whoever.net
> To unsubscribe send a blank email to $subst('Email.Unsub')



More information about the LUAU mailing list