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: liquidgood on Nov 02, '03 01:47:58PM
this is a great hint!

you can paste that code in a text file, chmod 755 it and put it somewhere in your $PATH, like ~/bin.
or if you use zsh, add this to your functions file:

function manps { man -t "$1" > /tmp/"$1".ps; open /tmp/"$1".ps; }

this works exactly the same way, but it gets loaded when you login to the terminal.

[ Reply to This | # ]
10.3: Easily view man pages with Preview
Authored by: defpo on Nov 02, '03 01:56:03PM

Thanks guys. I thought what rob said was for something else. Up and running!



[ Reply to This | # ]
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 | # ]