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


Click here to return to the 'Use groff to easily create PDF pages' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Use groff to easily create PDF pages
Authored by: gunnmjk on Oct 24, '05 12:40:14PM
I forgot where I got this from, but a better way too open man pages in Preview.app is this script


#!/bin/bash 

if [ $# -eq 0 ] 
# "$#" is number of parameters- here we test whether it is not equal to 0 
then 
echo "Usage: $0 <UNIX command> ..." # not one parameters 
# so print message 
exit 2 # and fail ($0 is # name of command). 
fi 

man -t $1 | pstopdf -i -o /tmp/$1.pdf 
open -a /Applications/Preview.app /tmp/$1.pdf 
( sleep 60; rm -f /tmp/$1.pdf) &

Call it pman, make it executable, put it in the $PATH, and just type "pman name_of_unix_app" in the terminal and it will open it up in Preview.

[ Reply to This | # ]
viewing piped postscript
Authored by: WhisperLite on Nov 15, '05 09:11:10PM

Even easier is to just pipe your output open with '| open -a /Applications/Preview.app/ -f'. This'll open your PostScript (or what-have-you) up in Preview without writing it to an intermediate file.



[ Reply to This | # ]