Unix Printing issue

I am currently struggling with attempting to print text files on a SCO 5.0.7 server to a network printer. The printer is an Hp LJ P2015dn There is an existing printer set up, and when I do a:

lp -d myprinter /etc/hosts

the first line of the hosts file is all that prints. I even attempted to use "netcat" to send text directly to the printer using:

cat /etc/hosts | netcat -h myprinter -p 9100

I continue to get the same results, only the very first line in the hosts file will print. I have attempted this on other text files and still the 1st line is all that prints. Please help.

Andy

man lpadmin...

I am looking for someone who has experienced the problem of only a single line of a text file being printed. Obviously I tried lp first to print to this network printer, and it should just work, as in my first example. I then tried netcat which is a program that is basically cat but to a network port on a print server, which removes the Lp world from the printing process completely with the same results.

I'd expect any modern unix O/S to come with a generic HP Laserjet model script and instructions for setting up network printing.

General answer to your question:
It's probably trying to print the whole file on one long line and truncating.
In general you need process the print file into a format suitable for printing. For example changing from the unix terminator of just <line feed> to the printer line terminator of <carriage return><line feed>. I would expect this to be the default option when correctly configuring a unix printer.

Sorry, not used SCO unix for over 10 years and even then I used "lpr" not "lp".

First of all

uname -a -v 

Is this HP-UX, Solaris or what ?

I suppose that you have solved this problem by now, but for the benefit of others:
You need to add and escape sequence to the beginning of the print file, since it seems not to be in the driver (model file).
Add "<esc>&k2G" to turn line feed into carriage return linefeed.