Thursday 26 May 2011

Open formatted man pages in Preview from the command line

I spend a lot of time reading man pages. Normally, the system pager less is fine for this. Occasionally, they're big enough or important enough that I want to keep them open in a window and read them at leisure. For those cases, I made a 2-line shell script pdfman.sh that runs man to generate postscript and presents the formatted output through preview.

Here is the script:
 #!/bin/sh ps=`mktemp -t manpageXXXX`.ps man -t $@ > "$ps" open "$ps" 

[crarko adds: There are a number of ways to accomplish the viewing of man pages in Preview such as this older hint. The method can vary between versions of Mac OS X. The present hint is an addition to the list of methods.]

Add to digg Add to Reddit Add to Slashdot Email this Article Add to StumbleUpon

Source: http://feeds.macosxhints.com/click.phdo?i=a4d1f5c2c42265ced2d83283f525c912

apple news apple breaking news mac tablet news imac

No comments:

Post a Comment