Created
May 17, 2011 10:15
-
-
Save amadamala/976237 to your computer and use it in GitHub Desktop.
Viewing man pages as pdf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add the following code to your ~/.bash_profile. | |
pman() | |
{ | |
PMANFILE="/tmp/pman-${1}.pdf" | |
if [ ! -e $PMANFILE ]; then # only create if it doesn't already exist | |
man -t "${1}" | pstopdf -i -o "$PMANFILE" | |
fi | |
if [ -e $PMANFILE ]; then # in case create failed | |
open -a /Applications/Preview.app/ "$PMANFILE" | |
fi | |
} | |
# alias man = pman | |
# Restart terminal | |
# usage: | |
# man diff | |
# source http://www.mattryall.net/blog/2007/08/man-pages-pdf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment