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


Click here to return to the 'Read Unix manpages in Safari via the shell and Bwana' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Read Unix manpages in Safari via the shell and Bwana
Authored by: kirkmc on Dec 09, '04 11:52:24AM

Um, why not do it the easy way:

open man:man

Then just swtich to your browser.

---
Read my blog: Kirkville -- http://www.mcelhearn.com
Musings, Opinion and Miscellanea, on Macs, iPods and more



[ Reply to This | # ]
Read Unix manpages in Safari via the shell and Bwana
Authored by: gospodin_david on Dec 09, '04 12:39:18PM

There is one problem with this approach. If Safari is open, but there are no Safari windows open, "open man:" doesn't do anything.



[ Reply to This | # ]
Read Unix manpages in Safari via the shell and Bwana
Authored by: osxpounder on Dec 09, '04 03:23:53PM

It doesn't do anything for me even with Safari running and at least one Safari window open -- the one I'm using now to write to you.

Was I supposed to type "open man:man" in the Safari address bar instead of in Terminal? Neither approach did anything for me.

---
--
osxpounder



[ Reply to This | # ]
Read Unix manpages in Safari via the shell and Bwana
Authored by: MattHaffner on Dec 09, '04 03:49:17PM

Did you download Bwana? You have to download it first before anything will happen. It *is* the handler for 'man:' URLs. Then you can type "man:man" in Safari or "open man:man" in the terminal (or use the shell script above...).

mh



[ Reply to This | # ]
Read Unix manpages in Safari via the shell and Bwana
Authored by: osxpounder on Dec 10, '04 01:25:33PM

Ah, OK. I misunderstood. I thought the advice meant that Bwana wasn't needed. Thanks for clearing that up for me!

---
--
osxpounder



[ Reply to This | # ]
Read Unix manpages in Safari via the shell and Bwana
Authored by: aaronrp on Dec 09, '04 03:39:56PM

That's one problem. Also, at least on my system, it replaces the currently open web page with the manpage -- which, usually, is not what I want, since I may want to leave the currently open web page open. The script opens a new tab for it.



[ Reply to This | # ]
Even easier...
Authored by: Viridian on Dec 09, '04 08:14:24PM
Thanks for the great hint kirkmc, but here's something even easier than typing 'open man:[command]' each time. I used your hint and created a shell alias (tcsh; I'm too lazy to get around to learning about bash):

alias mn 'open man:\!:1'

So I just type 'mn [command]' now. Of course, you can change 'mn' to any name that suits you. The only problem is that the alias won't accept nothing as a command (for calling up the index with 'man:'), so I created another alias for that:

alias mndx 'open man:'

Bwana's great by the way, and I tried the script in the hint, but it didn't open a new tab in Safari, it just loaded in the front-most window. Otherwise it worked, but returned the error message,

'syntax error: Expected expression but found end of line. (-2741)'

Anyone have an idea as to what's happening here?



[ Reply to This | # ]
Read Unix manpages in Safari via the shell and Bwana
Authored by: covisp on Mar 19, '06 07:15:47AM

While typing "open man:man" at the command line does work, the problem is that it loads that into the current browser window. This is never what I want.

However, the script posted has a rather long delay between opening a new tab and loading the man page into the new tab.

It's too bad that Applescript cannot tell Safari to open a URL in a new tab, or even a new window, without using the GUI Scripting, which is so very slow.

I think something might be possible with the do javascript command, however.

do JavaScript "window.open('man:man', 'bwama')" in document 1

works, but despite naming the window, it still loads the url into whatever window/tab is frontmost when it finally gets around to actually loading the URL. On my machine that's a delay of three or four seconds, easily long enough to have switched windows. In short, this is no better than the previous solution. I hope that this might lead someone to a solution that does work.



[ Reply to This | # ]