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

Click here to return to the '10.3: Easily view man pages with Preview' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.3: Easily view man pages with Preview
Authored by: sapporo on Nov 02, '03 02:44:06PM
If you regularly view large manpages, you might want to add caching, too. This function creates a pdf if it isn't there already and opens it (that's one single line of course):

function manpdf { if [[ ! -r /tmp/"$1".pdf ]]; then man -t "$1" | pstopdf -i -o /tmp/"$1".pdf; fi; open /tmp/"$1".pdf; }

I guess it could use some error handling to let it fail gracefully in case no man page is found, but I'll leave that up to you.

[ Reply to This | # ]