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

TARGETDIR=~/Sites/MAN
[ -d "$TARGETDIR" ] || mkdir "$TARGETDIR"

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



[ Reply to This | # ]