I have a dot matrix printer, an Epson LQ-500.
It works well with CUPS, and I use it to print listings sometimes, text files, etc.
now, I'd like to use it as a logging printer. for that, I need it to print a line, when it is appended to a file or named pipe.
I was thinking about using something like this:
tail -n1 -f file | lpr -l -h -P Epson-LQ-500
but it doesn't work, the print job is constantly held. Then I tried this:
tail -n1 -f file | lp -d Epson-LQ-500 -o raw -H immediate
and it doesn't work either, the print job is held indefinitely.
-f, or when using
cat it all works fine, but CUPS just won't let it print line-by-line.
So, how do I do that?