|
|
Very much improved
#!/bin/sh
if [ $# -eq 2 ]; then
m=`man -w $1 $2` || exit
PAGE=`basename $m`
PDF=/tmp/$PAGE.pdf
if [ ! -e $PDF ]; then
c=`grog $m`
$c | ps2pdf - $PDF
fi
open $PDF
else
m=`man -w $1` || exit
for x in $m; do
PAGE=`basename $x`
PDF=/tmp/$PAGE.pdf
if [ ! -e $PDF ]; then
c=`grog $x`
$c | ps2pdf - $PDF
fi
open $PDF
done
fi
Using this version you can use the standard BSD 'man' semantics for looking up man pages - ie. % superman ls % superman open % superman 2 open Where there are multiple matches - all matching pages are opened as PDF files. Again checks are made to stop duplicating already created pages, and to exit cleanly if there are no matches.
Very much improved & smaller
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/shSimple eh? :) |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.08 seconds |
|