Remote man pages

January 16th, 2007 by admin

This pretty slick trick(via Daring Fireball) tells how to open remote man pages with BBEdit. I think it’s definining some sort of function in bash? I’ve never seen the function command used before, so I assume it’s a trick with some shell.

Mmm, indeed – it’s a bash function. If you use bash (and you might, because it’s the OS X default shell) there are TextWrangler instructions for bash in the comments of the original link … you’d add the function to your .bashrc file.

Being as how I use tcsh, and TextWrangler rather than BBEdit, I modified this tip to work as a shell script. I created a file manb, made it executable, put it in my path. It contains:

  #/bin/csh

  ssh $argv[1] man $argv[2] | col -b | edit -t "$2@$1" --clean --view-top

mmm, the last lines are --clean --view-top which appear to run off the edge of the screen. So, the idea is you type “manb remotehost ssh” and the ssh man page opens up in TextWrangler on your computer from the remote machine. Now, cooler would be able to type a command on the remote machine and open it up on your own computer … but seeing as how I rarely actually read man pages remotely, I haven’t bothered to try and write such a script.

For reading man pages that reside on your Mac, I highly recommend ManOpen, which includes a command line utility “openman” which you can type instead of “man.”

.

Please remember this is the archive of Macsingularity. Comments are no longer supported, and this content and site are no longer updated.


2 Responses to “Remote man pages”

  1. 1

    vanni Says

    I am not able to do this as i need a better example. Can you post a real example leaving out host and passwd… thx

  2. 2

    Marcos Says

    Well, assuming you successfully made the shell script “manb” and it is executable and in your path… then you will just type

    % manb host command

    and it should work… so for example

    % manb computer.university.edu tcsh
    

    and it would grab the man page on tcsh from computer.unevirsity.edu and show it in Textwrangler.

    You have to have Textwrangler installed and its command line tools as well.



Bad Behavior has blocked 398 access attempts in the last 7 days.