The 03.03.01 at 18:21, John LeMay wrote:
Is there a simple way to automatically print out each entry made to a log file to a simple line printer? Basically something that would work like "tail -f logfile > lpr" (which doesn't work BTW) sans page feeds on the printer.
[thinkink aloud] tailf logfile | somescript somescript while read LINE ; do echo "$LINE" >> anotherfile if wc -l anotherfile greater than 100 then lpr anotherfile and delete it done < stdin This is just an idea, and it doesn't work as is... perhaps you'd need to do it in C.
Granted, one could script something to read the last line of the logfile, store it in a variable, and then reread the file every minute
At least, the above does not reread the file.
or so printing out any changed lines and updating the variable. However, I figure someone somewhere must have had to do this already. Maybe?
I don't know... -- Cheers, Carlos Robinson