lpd, /etc/printcap

Hi,
I want to use a TCP/IP HP-4050TN printer. Access is ok but I have to use a lpf like filter to insert CR/LF as end of line. Classical!
So, I’ve declared the following definition in my printcap file:

lj-4050TN|HP-4050TN:
:lp=:
:rm=HP-4050TN:mx#0:
:sd=/usr/spool/output/lpd/HP-4050TN:
:if=/etc/printers/lpf:

lpf file is a classical shell script which you can find in linux’s printers-Howto:

#!/bin/sh
if [ “$1” = -c ]; then
cat
else
sed -e s/$/^M/
fi


The problem is that I’m almost sure that my filter is not called, because I can put anything in this lpf file, the result is always the same, the printer prints lines with LF only!

I tried with lpr sample.txt, lpr -l sample.txt, nothing changes.
I aslo tried with a perl filter, same.


Is anybody have an idea to test something?

Thanks, Alain.

Try adding :rp=text to your printcap entry. You may also want to
add a “lj-4050PS” printer with :rp=raw for Postscript.
… at least this is what we do for QNX4
Richard

Alain Bonnefoy wrote:

Hi,
I want to use a TCP/IP HP-4050TN printer. Access is ok but I have to use a lpf like filter to insert CR/LF as end of line. Classical!
So, I’ve declared the following definition in my printcap file:

lj-4050TN|HP-4050TN:
:lp=:
:rm=HP-4050TN:mx#0:
:sd=/usr/spool/output/lpd/HP-4050TN:
:if=/etc/printers/lpf:

lpf file is a classical shell script which you can find in linux’s printers-Howto:

#!/bin/sh
if [ “$1” = -c ]; then
cat
else
sed -e s/$/^M/
fi

The problem is that I’m almost sure that my filter is not called, because I can put anything in this lpf file, the result is always the same, the printer prints lines with LF only!

I tried with lpr sample.txt, lpr -l sample.txt, nothing changes.
I aslo tried with a perl filter, same.

Is anybody have an idea to test something?

Thanks, Alain.

Alain Bonnefoy wrote:

Is anybody have an idea to test something?

A quick thought and a common glitch: Are you sure that the escapes ()
are escaping the linefeeds (ie, there’s no space/tab/etc after them)?