The man utility is an ancient and good way of documenting command line tools in Unix. The downside is that it will display it in some sort of Unix pager, and I can never figure out how to go back up a page. This can be a pain when you are going through a ton of switch descriptions, and you pass the one you want to read. The only alternative is to exit, reload, and then try to stop on the right page. This script (below the fold) I put together will keep a copy in PDF form and open it in preview. The caching feature is nice because the conversion can be a bit slow at times.
# !/bin/bash
if [ "$1" ]; then
f=~/UNIX/manpdf/$1.pdf
if [ -e $f ]; then
open $f
else
mantest=`man -w $1`
#echo $mantest
if [ ! -z $mantest ];then
echo Converting...
man -t $1 | pstopdf -i -o $f
open $f
else
echo No man page available for $1
fi
fi
fi
1 comment so far ↓
Great idea!
shrop
Leave a Comment