- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Problems with Interface Script for Remote Printer
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-22-2002 05:57 AM
07-22-2002 05:57 AM
printer to my 11i system (rp5470) using SAM so I could get as much stuff
defaulted as possible.
The Oce is on the network via a PC interface, and thus anything that gets sent
to the printer needs to be pushed thru the ux2dos filter on the way out. I'd
like to just have the interface script deal with invoking ux2dos, due to the
facts that (a) my user base isn't all that sophisticated and (b) trying to get
everyone to remember to precede all printing with "ux2dos" seems like it's
something that could more easily be handled at the system level.
In other words, instead of forcing my users to *always* use
ux2dos <
I'd like to just plop the invocation of "ux2dos" in the right place in the
Oce's interface script. However, I'm stumped as to where's the correct place
to insert the ux2dos command. Depending on what I do in the script, I get
multiple copies of my files output. Please read on...
The original interface script had, after dealing with any options passed to
it, the following:
shift; shift; shift; shift; shift
/usr/sbin/rlp -I$requestid $BSDC $BSDJ $BSDT $BSDi $BSD1 $BSD2 $BSD3 $BS
D4 $BSDw $BSDformat $BSDh $1
I first inserted the lines
ux2dos <$1 >/tmp/ux2dos$$
mv /tmp/ux2dos$$ $1
just before the rlp. This works fine if the input to lp(1) is either a single
file or an input pipe. If the lp command is for two files -- like lp a b --
then "a" would be pushed thru ux2dos but b got passed across "raw".
OK, so I changed that section of the script to
spoofles="$*"
holdRet=0
for spoolfile in $spoofles
do
ux2dos <$spoolfile >/tmp/ux2dos$$
mv /tmp/ux2dos$$ $spoolfile
#echo "Before rlp on spoolfile $spoolfile" >> /tmp/mrlptr
/usr/sbin/rlp -I$requestid $BSDC $BSDJ $BSDT $BSDi $BSD1 $BSD2 $BSD3 $BS
D4 $BSDw $BSDformat $BSDh $spoolfile
ret=$?
if [ $ret != 0 ];
then
holdRet=$ret
fi
done
This, too, works fine when lp is fed either an input pipe or a single file.
When I try printing two files at once, though, I get *FOUR* files on the
printer. Using "lp a b" again, I get an un-ux2dos-ed copy of "a", an
un-ux2dos-ed copy of "b", a ux2dos-ed copy of "a", and a ux2dos-ed copy of
"b".
If I uncomment the echo command in the middle of loop, I see only *two*
messages sent to the trace file in /tmp -- yet somehow *four* things got
thrown at the rlp command, even though the interface script showed that
we fell thru the section with rlp *twice*.
Can anyone slap me up-side the head and show me where I've screwed this up?
If two files are fed to lp for this printer, I'd like to see *two* files
get printed, both of them having gone thru ux2dos. I can underkill and
overkill this problem, but I can't just kill it.
Help? Please?
Mike Reaser
Southeastern Data Cooperative
Tucker, GA
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2002 06:09 AM
07-22-2002 06:09 AM
Re: Problems with Interface Script for Remote Printer
Try
/usr/bin/ux2dos $1 > /tmp/$$
mv /tmp/$$ $1
/usr/bin/rlp ......(as "usual")
Steve Steel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2002 06:21 AM
07-22-2002 06:21 AM
Re: Problems with Interface Script for Remote Printer
With those lines in the script, if I push two files to the printer at once -- lp a b -- then "a" makes it thru ux2dos and looks OK when it get laid on paper, while "b" does *not* get run thru the ux2dos filter and
gets printed in "stair-step"
mode.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2002 06:25 AM
07-22-2002 06:25 AM
Re: Problems with Interface Script for Remote Printer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2002 06:41 AM
07-22-2002 06:41 AM
Re: Problems with Interface Script for Remote Printer
It is always 1 file.
See this remote print
# lp -dtester *
request id is tester-4218 (4 files)
# cat /tmp/testres
/usr/sbin/rlp -Itester-4218 -J/nff /var/spool/lp/request/tester/dA4218xantia
It makes a data file of all inputs and sends that.
If you have a problem then you need to make an ordinary printer which handles multiple files on a false name and in that script do a print file by file to the real printer.
Steve Steel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2002 11:09 AM
07-22-2002 11:09 AM
Re: Problems with Interface Script for Remote Printer
I decided to turn the problem "on its side", and instead of trying to beat myself up to get ux2dos integrated into the interface script, wrote a wrapper for the "lp" command which will push files thru ux2dos when appropriate.
The wrapper is attached, for anyone curious about it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2002 11:42 AM
07-22-2002 11:42 AM
Re: Problems with Interface Script for Remote Printer
Have you tried with the Script dumbplot_printer_cr , with carrige return option? You can try with that.
Sandip
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2002 11:47 AM
07-22-2002 11:47 AM
Solution(Realizing this for the first time, I now have modify my own scripts to properly iterate through a list if a user decides to print more than one file at a time.)
So Mike, even though rlp takes only one file parameter, it actually will process the remaining data files for the job.
Try this between the shifts and rlp:
shift; shift; shift; shift; shift
for f in $@
do
ux2dos $f > $f.tmp
mv -f $f.tmp $f
done
/usr/sbin/rlp ...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2002 10:48 AM
07-23-2002 10:48 AM
Re: Problems with Interface Script for Remote Printer
Your suggestion "did the trick" and now my Oce printer will happily print straight down the left side of the page instead of "stair-stepping".
Thanks again!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2002 01:14 PM
07-23-2002 01:14 PM
Re: Problems with Interface Script for Remote Printer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2002 03:15 PM
07-23-2002 03:15 PM
Re: Problems with Interface Script for Remote Printer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2002 07:31 AM
09-12-2002 07:31 AM
Re: Problems with Interface Script for Remote Printer
I promised to post our interface script for the Oce 8400 series. It supports PCL5 and PostScript options if desired. Please respond with any problems or enhancements.