Hello Gordon,

I'll attach, in a separate off-list post, the PDF file that I get from my 
system (Mac OS X 10.6.8) when I do a man on certtool.  As I mentioned, I'd do a 
Google search on "man certtool apple developer" to get the web page for this 
man entry at the Apple Developer site:
<http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man1/certtool.1.html>

You can generate a PDF file of a "man" command that will be displayed in 
Preview with:

man -t certtool | open -f -a /Applications/Preview.app

The beginning of the command "man -t certtool" creates a PostScript output 
version of the man command for "certtool" and sends it to stdout.  I wanted to 
send it directly to a printer, I'd pipe it to "lp":

man -t certtool | lp 

If I want to generate a PDF file and read this on my screen, I'll instead 
direct this open in the Preview application, which will automatically convert 
the PostScript format to PDF, and display it.

Now, for a faster option for my own reading with VoiceOver, I can send this 
output to TextEdit instead of Preview:

man certtool | col -b | open -f -a "TextEdit"

It's easier to have my shell set up with a definition, so I don't have to type 
all the commands. On my account I keep a ".profile" file with definitions for 
both a "pman" and a "tman" command that can be typed as a Terminal command 
instead of "man".  So when I type "pman certtool", the output man command will 
automatically show up in Preview and "tman certtool" will automatically show up 
in TextEdit.  Here are the two definitions in my user account's ".profile" file 
(where I've enclosed the name of the file in quotes, so the initial "dot" 
prefix is noted).

pman()
        {
        man -t "${1}" | open -f -a /Applications/Preview.app/
        }
tman()
{
man "${1}" | col -b | open -f -a "TextEdit"
}

I'll bet Travis could also suggest some methods/refinements.

HTH.  Cheers,

Esther

On Aug 15, 2011, at 01:43, Gordon Smith wrote:

> Hello Esther
> 
> Thank you for the below.  I'm replying on Lynne's behalf as she's had to go 
> into work to cover for somebody.
> 
> All she wants to do is display the man page for a single command at the 
> moment.  I'm not sure whether the standard version of Lion would have it 
> actually because it's only required on the server OS.
> 
> But what she's trying to do is to get an output form the external command 
> "/usr/bin/certtool".
> 
> It's unfortunate that this has to be such a messy issue.  You'd think that 
> you could simply dump it to a text file.
> 
> Thanks for the below; I will investigate for her.
> 
> Gordon
> 
> 
> On 15 Aug 2011, at 12:14, Esther wrote:
> 
> Hello Lynne,
> 
> There are several ways to display man pages using scripts in Terminal, as 
> summarized recently, for example, in this Mac OS X Hints page titled "Open 
> formatted man pages in Preview from the command line":
> <http://hints.macworld.com/article.php?story=20110511111211385>
> 
> The man pages are also available at the Apple Developer's site, and if I want 
> to refer someone to the man page definition in a post, I'll google the 
> command to post a URL (e.g. "man <name of command> apple developer").  The 
> complete man pages are available from:
> <http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/index.html%23//apple_ref/doc/uid/TP40000894>
> 
> However, if you don't want to create a script or put a definition in a 
> ".profile" file in your account, try looking into Bwana, which is a freeware 
> app that is Lion ready, and which will display the man pages in Safari. 
> Here's the URL of a recent blog post, "Man Pages Made Easy", that gives 
> examples of how to use Bwana, and also gives a link to the download location:
> http://krypted.com/mac-os-x/man-pages-made-easy/
> 
> Alternatively, there's a $2.99 app in the Mac App Store called "Man Page 
> Viewer" that you can try.  (Bwana should actually give you more capabilities, 
> but this looks like it might be a simple solution).  The other options either 
> involve apps that I'm not sure are still supported under Lion, or else which 
> I don't feel necessarily justify the price (e.g. the $25 price for Manpower 
> in the Mac App Store).  I haven't tried the options mentioned in these last 
> two paragraphs myself, but they're what I would look into.
> 
> HTH.  Cheers,
> 
> Esther
> 
> On Aug 14, 2011, at 23:35, Mrs. Lynnette Annabel Smith wrote:
> 
>> Hello everybody
>> 
>> Does anybody happen to know whether there is a way to dump the output of a 
>> man page in terminal to a text file? I need to refer to the syntax of a 
>> command but I would prefer to have it available in front of me as I work. So 
>> what I thought I could do was to dump it to a text file and then print it 
>> out. But the usual method doesn't seem to work on this occasion and it looks 
>> as though the information on the command I'm looking at is a multi-page 
>> command.
>> 
>> Lynne
> 

<--- Mac Access At Mac Access Dot Net --->

To reply to this post, please address your message to mac-access@mac-access.net

You can find a monthly formatted archive of all messages posted    to the 
Mac-Access forum at the following URL:
<http://mail.tft-bbs.co.uk/pipermail/mac-access/index.html>

The Mac-Access mailing list is guaranteed malware, spyware, Trojan, virus and 
worm-free!

Please remember to update your membership options periodically by visiting the 
list website at:
<http://mail.tft-bbs.co.uk/mailman/listinfo/mac-access/options/>

Reply via email to