Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Very much improved & smaller' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Very much improved & smaller
Authored by: owain_vaughan on May 18, '01 05:44:45AM
Just in case everybody isn't bored by this already - this is the version I now use. It's pretty much identical to the previous one, but redundant variables are removed and therefore the new one-line 'if' blocks can be compressed onto one line....
#!/bin/sh
if [ $# -eq 2 ]; then
m=`man -w $1 $2` || exit
PDF=/tmp/`basename $m`.pdf
[ ! -e $PDF ] && `grog $m` | ps2pdf - $PDF
open $PDF
else
m=`man -w $1` || exit
for x in $m; do
PDF=/tmp/`basename $x`.pdf
[ ! -e $PDF ] && `grog $x` | ps2pdf - $PDF
open $PDF
done
fi
Simple eh? :)

[ Reply to This | # ]