Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SCO UNIX cannot print multiple pages with lp -n command

Status
Not open for further replies.

joshtgn

Technical User
Dec 9, 2002
2
AU
I have a problem using the lp command. I'm trying to print multiple copies using the -n switch. Problem is that I get no error but only one copy will print.
Command I'm using is lp -n 2 -dprintqueue filename or lp -n2 -dprintqueue filename.
Any advice or help would be greatly appreciated.

Thanks


 
This will depend on the interface file that you are using for the printer.

Most scripts will take the fourth parameter as the number of copies to print. This parameter is supplied by the lp daemon not your "lp -n 2 -d printer file" command.
 
I'm coming across this problem too (only 1 copy prints).

I'm running SCO 4.2 and printing to a HPLaserJet with JetDirect.
I'm using remote printing (rlpconf, mkdev rlp).

Where the heck is the interface file? I don't recall being asked for it during printer install in SCO.

 
The number of coppies is a parameter passed to the interface script. It is the responsibility of the interface script to manage spooling the job the correct number of times.

If you build your own interface file that simply cat's the file to the printer or to a print program such as smbprint, you may have overlooked programming for this parameter. Or if your interface came off of the web, or from a source that is not specific to SCO, it may not have multiple copy compatibility.

Adding your own logic to an interface file for multiple copies is not too difficult:

At the top of the interface file add the line:
Code:
copies=$4

Just above the interface code that processes spooling the file to the printer, add the following lines:
Code:
copy=$copies
while [ $copy -ge 1 ]
do

Just below the interface code that processes spooling, add the following lines:
Code:
copy=`expr $copy - 1`
done
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top