HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Sed in model.orig file
Operating System - HP-UX
1837191
Members
2568
Online
110114
Solutions
Forums
Categories
Company
Local Language
back
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
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- 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
03-17-2003 04:55 PM
03-17-2003 04:55 PM
Dear all,
I have been toying with a sed that I use with no trouble on solaris in a BSD /etc/printcap output filter for a remote printer.
(We use this to handle messy postscript output from cups on a HPUX server to a XEROX docuprinter 350 that does not understand higher level postscript.)
To replace this functionality in HPUX, I have created two printers on a second HPUX server. One a dumb plotter and two a remote printer.
I direct the cups output from one server to a dumb plotter on the second server. The model.orig file is modified to include the postscript replacement sed. This printer then farms off the job to a remote printer on the same host which in turn farms off the job to the Docuprinter print server.
The insert line of the sed when included does not send output to the printer, however it works on its own.
I hope I am not making this way too complex but could not see a simpler way to do it.
Any thoughts would be gratefully accepted.
Here is model.orig file.
# @(#) $Header: /users/hpnp/odyssey/repository/sh/dumbplot_printer.psh,v 1.2 1999/04/21 06:52:12 hpnp Exp $
#
# lp interface for dumb plotter
#
copies=$4 # CHANGE COPIES
# Handle disable and cancel traps
trap "trap 15;kill -15 0;exit 0" 15
# The remaining arguments are files
shift; shift; shift; shift; shift
files="$*"
# Plot the spooled files
i=1
while [ $i -le $copies ]
do
for file in $files
do
cat "$file" 2>&1 | sed -e '{
s?/MediaPosition 1?/MediaColor(silver)?
s?/MediaPosition 0?/MediaColor(white)?
/%%LanguageLevel: 2/i %%DocumentMedia: white 595 842 0 white () %%+ silver 595 842 0 silver () %%+ yellow 595 842 0 yellow () %%+ blue 595 842 0 blue ()
}' | lp -d
done
i=`expr $i + 1`
done
exit 0
I have been toying with a sed that I use with no trouble on solaris in a BSD /etc/printcap output filter for a remote printer.
(We use this to handle messy postscript output from cups on a HPUX server to a XEROX docuprinter 350 that does not understand higher level postscript.)
To replace this functionality in HPUX, I have created two printers on a second HPUX server. One a dumb plotter and two a remote printer.
I direct the cups output from one server to a dumb plotter on the second server. The model.orig file is modified to include the postscript replacement sed. This printer then farms off the job to a remote printer on the same host which in turn farms off the job to the Docuprinter print server.
The insert line of the sed when included does not send output to the printer, however it works on its own.
I hope I am not making this way too complex but could not see a simpler way to do it.
Any thoughts would be gratefully accepted.
Here is model.orig file.
# @(#) $Header: /users/hpnp/odyssey/repository/sh/dumbplot_printer.psh,v 1.2 1999/04/21 06:52:12 hpnp Exp $
#
# lp interface for dumb plotter
#
copies=$4 # CHANGE COPIES
# Handle disable and cancel traps
trap "trap 15;kill -15 0;exit 0" 15
# The remaining arguments are files
shift; shift; shift; shift; shift
files="$*"
# Plot the spooled files
i=1
while [ $i -le $copies ]
do
for file in $files
do
cat "$file" 2>&1 | sed -e '{
s?/MediaPosition 1?/MediaColor(silver)?
s?/MediaPosition 0?/MediaColor(white)?
/%%LanguageLevel: 2/i %%DocumentMedia: white 595 842 0 white () %%+ silver 595 842 0 silver () %%+ yellow 595 842 0 yellow () %%+ blue 595 842 0 blue ()
}' | lp -d
done
i=`expr $i + 1`
done
exit 0
Solved! Go to Solution.
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2003 01:59 AM
03-18-2003 01:59 AM
Solution
1. piggy-bag or dummy (redirecting) printers should have their interface script on /etc/lp/interface, not on .../model.orig
Piggy-bag printers do not only not need HPNP interfering, they don't want to.
The structure is OK, but it would be even more efficient to place the whole loop in one single lp command
# Plot the spooled files
(
i=1
while [ $i -le $copies ]
do
for file in $files
do
sed -e '{
s?/MediaPosition 1?/MediaColor(silver)?
s?/MediaPosition 0?/MediaColor(white)?
/%%LanguageLevel: 2/i %%DocumentMedia: white 595 842 0 white () %%+ silver 595 842 0 silver () %%+ yellow 595 842 0 yellow () %%+ blue 595 842 0 blue ()
}' < "$file" 2>&1
done
i=`expr $i + 1`
done
) | lp -s -d
exit 0
Piggy-bag printers do not only not need HPNP interfering, they don't want to.
The structure is OK, but it would be even more efficient to place the whole loop in one single lp command
# Plot the spooled files
(
i=1
while [ $i -le $copies ]
do
for file in $files
do
sed -e '{
s?/MediaPosition 1?/MediaColor(silver)?
s?/MediaPosition 0?/MediaColor(white)?
/%%LanguageLevel: 2/i %%DocumentMedia: white 595 842 0 white () %%+ silver 595 842 0 silver () %%+ yellow 595 842 0 yellow () %%+ blue 595 842 0 blue ()
}' < "$file" 2>&1
done
i=`expr $i + 1`
done
) | lp -s -d
exit 0
Enjoy, Have FUN! H.Merijn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-18-2003 08:56 PM
03-18-2003 08:56 PM
Re: Sed in model.orig file
I found that moving this file to /etc/lp/interface was the trick.
So thankyou very much,
Damo
So thankyou very much,
Damo
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP