Operating System - HP-UX
1833056 Members
2842 Online
110049 Solutions
New Discussion

LP printing to printer and file at same time

 
SOLVED
Go to solution
Matt Goodfellow_1
Occasional Advisor

LP printing to printer and file at same time

I have an HP-UX 11.0 system with a remote printer setup at a facility several miles away. I need to capture a copy of the print job as well as have it sent to the printer at the same time. Is there a quick and easy way to do this? The printing is contracted out and we are having issues with the prints being out of order. I need to ensure that the software that is printing is not sending the prints to the remote printer in the incorrect order. Thx in advance.
5 REPLIES 5
TwoProc
Honored Contributor
Solution

Re: LP printing to printer and file at same time

Run the lp command with a "tee" command. The following will save the output to (and keep appending to it) with each lp command called in the following way:
cat fname | tee -a /tmp/myprintlog | lp -dmyprinter

We are the people our parents warned us about --Jimmy Buffett
Matt Goodfellow_1
Occasional Advisor

Re: LP printing to printer and file at same time

The other issue which I should have mentioned is I cannot modify the code that uses lp to do the printing. I am under very tight change management control and the next time the software can be modified will not be until Sept. I was hoping I could do something outside the application with the printer definition, or /etc/lp/interface. So far I am still looking for a solution. Thanks,
Alan Meyer_4
Respected Contributor

Re: LP printing to printer and file at same time

How about supplying an alias for lp or a wrapper script for lp within the local environment that utilizes this script?
" I may not be certified, but I am certifiable... "
Matt Goodfellow_1
Occasional Advisor

Re: LP printing to printer and file at same time

That is probably what I will end up doing is writing a temporary alias or wrapper that will allow me to do this. Thanks for the responses.
Matt Goodfellow_1
Occasional Advisor

Re: LP printing to printer and file at same time

Thanks folks