tail -f | grep

whenever whatever at whoever.net
Sat Nov 18 00:37:30 PST 2000


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;
}
}



More information about the LUAU mailing list