Last active
December 28, 2015 08:19
-
-
Save sampart/7470419 to your computer and use it in GitHub Desktop.
Ubuntu-friendly version of the script at http://www.benzado.com/blog/post/319/nicer-ways-to-view-unix-man-pages; "manp" allows you to view man pages as nicely-formatted PDFs in your PDF viewer. The original Mac version linked to above was a function. This is a shell-script, so put it somewhere in your path. (I originally made this as a function …
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
#!/bin/bash | |
M=`man -w $*` # Get path of page source. | |
if [ -z $M ]; then exit; fi # Quit if it doesn't exist. | |
N=`basename $M .gz` # Extract the name of the file and | |
P=/tmp/man.$N.pdf # use it to create a PDF file name. | |
if [ ! -e $P ]; then # If the PDF file doesn't exist, | |
echo Creating PDF for $N... | |
man -t $1 | ps2pdf - $P # generate it. | |
fi | |
xdg-open $P # Open the PDF version. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I also really like the solution here to make the standard
man
command include colours (but I prefer the colour-scheme given on this page.)