Created
February 14, 2014 21:43
-
-
Save ahknight/9009950 to your computer and use it in GitHub Desktop.
Generate a PDF of a manpage for easier/offline reading. Great for zfs/zpool manpages…
This file contains hidden or 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
#!/bin/bash | |
MANFILE=$( man -w $1 $2 ) | |
NAME=$( basename $MANFILE ) | |
if [ -r $MANFILE ]; then | |
groff -mandoc $MANFILE -t | pstopdf -i -o "$NAME.pdf" | |
echo "wrote $NAME.pdf" | |
else | |
echo $MANFILE #Error message, probably. | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment