I view the
man pages for
GMT (Generic Mapping Tools) a lot, both on my local machine and the web. I find the online HTML version easier to read, but sometimes my PowerBook is not connected to the web and I need to consult the
man page. Here is a quick script that will make the
man pages available as local HTML files for access from the Dock. While I provide an example for GMT, it could be used to make a folder for any man page.
Requires: rman (or similar program) and in this case GMT. Both are available via
fink.
- Make a folder (herein entitled "GMT_man").
- In that folder (cd /path/to/GMT_man) in the Terminal.app, type:
% /bin/ls /sw/share/man/manl/ > list1
% /bin/ls /sw/share/man/manl/ | sed 's/\.\l//g' > list2
% paste list1 list2 > list2
% awk '{print "rman -f html /sw/share/man/manl/"$1,">", $2}' \
list2 > htmlit.csh
% chmod u+rwx htmlit.csh
- Lastly, execute the shell script:
% ./htmlit.csh
I then removed all of the lists and script and dragged the folder "GMT_man" to the Dock. Now when I want to view a man page of a GMT command, I just single-click the folder and pick from all of the commands. That then opens the HTML file in my default browser for viewing.