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


Click here to return to the 'paths problem' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
paths problem
Authored by: Anonymous on Jan 29, '03 12:11:54PM

When I type 'mywhois apple.com' I get: "mywhois: Command not found." But if I type the whole path to the script, it runs just fine. I seem to remember there being a shell preference I can set to have it automagically look in /usr/bin/ for commands, but I can't remember how to do it. Can someone refresh my memory?



[ Reply to This | # ]
paths problem
Authored by: Anonymous on Jan 29, '03 12:15:48PM

whoops. Nevermind I remembered it. For those who don't know, you can create a .tshrc file in your home directory with this line:

setenv PATH /usr/bin:$PATH

or

setenv PATH /usr/local/bin:$PATH

for stuff there. Works great, though I don't know if this is the way you're "supposed" to do it.



[ Reply to This | # ]
Use 'rehash'
Authored by: owain_vaughan on Jan 30, '03 06:41:50AM

/usr/bin should already be in your PATH, but in C-type shells you need to do a 'rehash' after putting new executables in a PATH directory. As a matter of neatness, non-system executables should go in /usr/local/bin anyway :)



[ Reply to This | # ]
Don't change your path!
Authored by: mholve on Jan 30, '03 09:38:34AM

You don't want to muck with your path, and don't have to.

To execute this script, wherever it is, use "./mywhois foo.com" or put the script somewhere that IS in your path, preferably something like "/usr/local/bin."

Make sure that once the script is entered, to do a "chmod 755 mywhois" to make it executable.



[ Reply to This | # ]