View nicely formatted 'man' pages

May 14, '01 04:18:48PM

Contributed by: Anonymous

If you'd like to read the "man" pages (UNIX manual pages) in PDF mode, here's how to do it.

The following shell script displays high quality man pages using Preview.app (or whichever PDF viewer the finder thinks to use):

#!/bin/tcsh
set m=`man -w $1`
set c=`grog $m`
$c | ps2pdf - /tmp/$1.pdf
open /tmp/$1.pdf
Save the script in your personal bin directory, e.g. ~/bin/superman. Set execute permissions: chmod +x ~/bin/superman. And then superman ls will present nicely typeset man pages.

NOTE: In order for this to work, You'll need ghostscript installed for ps2pdf.

Comments (7)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20010514161848549