Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the '10.4: Use Preview to view formatted man pages' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.4: Use Preview to view formatted man pages
Authored by: jack_givens on Jan 04, '06 06:58:17AM

I have done something similar to this for some time but I attempt to create a permanent PDF so that Spotlight can find the text in PDFs when I do a search. The script below will take a long time to proccess man pages and will sometimes fail on certain (poorly formed?) man pages. Once you run the script and Spotlight has done an update you will have many unix commands available for searching!

#! /bin/sh

[ -d "$TARGETDIR" ] || mkdir "$TARGETDIR"

for MDIR in /usr/share/man /usr/local/share/man /usr/X11R6/man
echo "${MDIR}..."
find "$MDIR" -type f | egrep ".[0-9]$" |
while read FILE
MANPAGE=`basename $FILE | cut -d. -f1`
man -t $MANPAGE | pstopdf -o "${TARGETDIR}/${MANPAGE}.pdf" -i
echo "...done"

[ Reply to This | # ]