1837260 Members
2443 Online
110115 Solutions
New Discussion

Printing unix man pages

 
SOLVED
Go to solution
NTC
Regular Advisor

Printing unix man pages

Hi all,

can someone help in how can i print unix man pages on a printer.

thanx
sbk
17 REPLIES 17
James R. Ferguson
Acclaimed Contributor

Re: Printing unix man pages

Hi:

One way is:

# man man | col -b | lp -d printername

Regards!

...JRF...
A. Clay Stephenson
Acclaimed Contributor

Re: Printing unix man pages

Generally it's no more complicated than:

man xxx | lp -dmyprinter
If it ain't broke, I can fix that.
Torsten.
Acclaimed Contributor

Re: Printing unix man pages

or go to

http://docs.hp.com/en/hpuxman_pages.html

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Sung Oh
Respected Contributor

Re: Printing unix man pages

You can redirect the man page to a file and modify the man page using text editor and print it.

# man xxx > print_file1
# vi print_file1
# lp print_file1

I hope this helps,

Sung
NTC
Regular Advisor

Re: Printing unix man pages

Thanx guys, i know much of these commands but the pb i have is when i print some pages disappear ( like 1st page print 2nd no , 3rd yes...) may be the printer driver is not good but i am usign the right diriver for LJ5000. any ideas?

Thanx
SBK

Re: Printing unix man pages

man xx | lp -dprinter_name -on -o12 -olm10 -otl66

example:
file /usr/local/bin/manpr

#! /usr/bin/sh
case $1 in
-d*) lpdest=$1; shift;;
esac
: ${lpdest:=-dmyprinterbydefaultformanpr}

man $* | lp $lpdest -on -o12 -olm10 -otl66



RAC_1
Honored Contributor

Re: Printing unix man pages

man â somethingâ | col â b | ssp | expand | lp -d"print_queue"
There is no substitute to HARDWORK
Tom Henning
Trusted Contributor

Re: Printing unix man pages

HP-UX does not use printer drivers for printer, just model scripts. So when you added the printer did you use a good model script for this printer? Is it printing everything else correctly?

Does the printer have a duplex unit attached? Sounds like the system is expecting to print duble-sided, since every even page is missing.

You might try adding the printer to the system again, using the dumb model script and see what happens.
What is it that possesses otherwise sane individuals to change something just because it has not been changed in a while?
Peter Nikitka
Honored Contributor

Re: Printing unix man pages

Hi,

- download and install the a2ps program
- use man xxx | a2ps -m --center-title="man xxx"

... gives excellent results on postscript printers and under linux.

mfG Peter
The Universe is a pretty big place, it's bigger than anything anyone has ever dreamed of before. So if it's just us, seems like an awful waste of space, right? Jodie Foster in "Contact"
Geoff Wild
Honored Contributor

Re: Printing unix man pages

How did you setup the printer?

Does it have a jet direct card?

If so, best way is to use HPPI or from the command line:

addqueue -i 9998 -q QUEUENAME -h printerdns.yourdomain.com

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
NTC
Regular Advisor

Re: Printing unix man pages

Hi All,
Thanx for the replies, unfortunalely pb not resolved yet. i am using jetadmin and choe the printer driver lj5000 and the real printer i have is lj5000N. i made the printer conf to use pcl language, im still having some paragraphs disappear when i print. I will have to try the a2ps to see if it works, but i wonder why it is not working with pcl, all the command you gave i tried and sill some lines disappear.

thanx
sbk
Ganesha Sridhara
Honored Contributor

Re: Printing unix man pages

Hello sbk,


If you have installed the apache (bundled with HP-UX) you can see man pages in browser and can be printed:

http://your-macine-name:port/cgi-bin/man2html

example:
http://myserver.mydomain.com:80/cgi-bin/man2html

HTH

Regards
Ganesha Sridhara

RAC_1
Honored Contributor

Re: Printing unix man pages

first try putting it into a file. Check this file and then try to print. Also if you run into same problem try using model script "dumb"

man "something" | col -b |ssp|expand > /tmp/something.txt
Check file. Then print it.
There is no substitute to HARDWORK
NTC
Regular Advisor

Re: Printing unix man pages

Rac , when i send the man output to a file it is correct no pb with that, i tried the dumb driver and i got some garbige, i may ry one suggestion from our colleague here to install a postscript driver and see if it works.
thanx all
sbk
Pete Randall
Outstanding Contributor

Re: Printing unix man pages

One more (potential) solution:

man 5 regexp | col -b | expand | lp -d myprinter


Pete

Pete
Bill Hassell
Honored Contributor
Solution

Re: Printing unix man pages

You mentioned jetadmin...that code has been obsolete for 6 years and is known to have problems with Y2K. And of course, it knows nothing about new printers like the LJ 5000. What version of HP-UX are you running? The replacement code for jetadmin is called HPPI (HP Printer Installer) and can be downloaded from:

10.20
http://h20000.www2.hp.com/bizsupport/TechSupport/DriverDownload.jsp?locale=en_US&pnameOID=18923&taskId=135&prodTypeId=18972&prodSeriesId=27350〈=en&cc=us

11.xx and higher
http://h20000.www2.hp.com/bizsupport/TechSupport/DriverDownload.jsp?locale=en_US&pnameOID=18922&taskId=135&prodTypeId=18972&prodSeriesId=27349〈=en&cc=us

And get the latest printer scripts (not really drivers) from:

http://www.hp.com/pond/modelscripts/index2.html

Note that the dumb model script is not useful with HP printers and using the postscript model script requires that the Postscript module be installed. The printer's selftest will tell you if it is present.

However, the printer scripts do not actually process the print jobs. They prepend and postpend codes to contgrol fonts and spacing for plain ASCII files, but without options, the file is printed as-is. You can bypass the printer script by using hpnpf with the -n option to handle end-of-record processing. The man page will show you the technique.


Bill Hassell, sysadmin
Steve Steel
Honored Contributor

Re: Printing unix man pages

Hi

man $*|lp -dprinter -on -otl66 -ol70


Always works for me


Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)