(?) The Answer Gang (!)


By Jim Dennis, Ben Okopnik, Dan Wilder, the Editors of Linux Gazette... and You!
Send questions (or interesting answers) to [email protected]


(!) netscape bash function

Answer From Allan Peda

Comments By Ben Okopnik, Heather Stern

I wrote a quick wrapper function to pass html directly to netscape if it is running, else to launch netscape with the local file. I find it quicker than clicking the file -> open .. menus since I have an xtern open all the time.

I simply type:

mybox]$ ns README.html

or

mybox]$ ns /tmp/README.html

It takes care of the rest.

Here (from .bash_profile):

See attached ns.bash.txt

(!) [Ben] One thing to be careful of, Allan: there is already a program called "ns" (/usr/bin/ns) that is part of the "dnsutils" package. It's a good idea to check for that kind of conflicts.

(!) [Allan Peda] Thanks:

This is where the various packages / Unices get confusing, since I don't have this on my desktop PC RH7 system.

Thanks for the tip.

apeda]$ unset ns
apeda]$ ns
bash: ns: command not found
apeda]$ ll /usr/bin/ns
ls: /usr/bin/ns: No such file or directory
apeda]$
(!) [Heather] If you do find a conflict, it's very easy to use capitals instead. For example, I gave my dad-in-law a bash alias named Elm which does some mail prep for him and then launches elm. So you could name your alias Ns and it is unlikely to bump heads... or even N, unless you like to use one character variables in your scripts a lot.
But definitely, thanks for the script!


This page edited and maintained by the Editors of Linux Gazette Copyright © 2001
Published in issue 64 of Linux Gazette March 2001
HTML script maintained by Heather Stern of Starshine Technical Services, http://www.starshine.org/


[ Answer Guy Current Index ] greetings   1   2   3   4   6   7   9 [ Index of Past Answers ]
11   12   15   16   18
20   22   24   25   26   28   29