- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- printer script
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2002 06:02 AM
07-10-2002 06:02 AM
Is it possible to take an existing print script such as that for a laserjet 4 and get it to send it's output to the remote printer.
Thanks in advance,
John.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2002 06:26 AM
07-10-2002 06:26 AM
Re: printer script
Othwewise, you'll have to add the CR before you print using: ux2dos file-to-print | lp ...
Add the printer using SAM and the remote printer menu.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2002 06:28 AM
07-10-2002 06:28 AM
Re: printer script
If I understand you right you want to set up a remote printer on a HP-UX client to a printer on a Windows system.
It is possible, but it is a job for a "hacker".
Create a remote printer on the HP-UX client. Now you have got a interface script in /var/spool/lp/interface.
Take a copy of the standard laserjet 4 interface script.
This two scripts must be "merged" so the print processing is done on the local system to a temporary file and this preprocessed file is sent to the remote printer instead of the original file.
When printing to a remote UNIX printer the print processing normaly is done remote.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2002 06:56 AM
07-10-2002 06:56 AM
Re: printer script
Is it easy to change this to send it all to a file say $1.tmp.
Regards,
John.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2002 07:09 AM
07-10-2002 07:09 AM
Re: printer script
Hi,
Just enclose the part of the script
that contains echo and cat in
( ) > unique_file_name
and everything that otherwise would have
gone to the printer now goes to unique_file_name.
Normally you would use the PID as part
of the file name. Ex /tmp/$$file_name
Olav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2002 08:32 AM
07-10-2002 08:32 AM
Re: printer script
You're in luck. I'm doing what you want to do with the attached interface script. However, my remote printers are no going through Windows servers, but rather directly to network attached printers. So I don't know for sure if this will work for you.
Study it carefully. It does all its work in the printer's spool directory (/var/spool/lp/request/
You must make sure the model scripts you will use are executable or the script will fail, disable the queue, and bitch about it via email to the lp admin. So do this:
chmod 555 /usr/lib/lp/model/PCL*
To setup the printers, just create remote printers like you normally would. Then replace the interface script in /etc/lp/interface with this script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2002 12:00 PM
07-10-2002 12:00 PM
SolutionI had a look at the laserjet4 model script in /var/opt/lp/model. It is rather complex but not difficult to understand. The script "echo" a lot of escape seqences and then finaly "cat" the file. This means evrything (with the exceptin of errors) is written to stdout. The stty commands is for serial ports, in your case you should remove them.
Some ideas:
Define a "modified" version (without stty) of the laserjet4 model interface script as a function in the main interface script.
Call this function with the nessesary parameters from the main script and redirect the output from this function to a temporary file.
Send this temporary file to the remote printer with rlp.
This need some work and it is not simple but it is not impossible.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2002 03:54 AM
07-12-2002 03:54 AM
Re: printer script
My script will now process the file correctly and every thing seems to work correctly as far as the 'rlp' line. When the file that should be going to the printer is called 'dfA123ptihp1.job' I will get an error in '/var/adm/lp/log' stating that 'cfA123ptihp1.job' can not be found.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2002 05:10 AM
07-12-2002 05:10 AM
Re: printer script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2002 05:15 AM
07-12-2002 05:15 AM