How do I make wget available everywhere?

markpatterson

Registered
I want to write a shell script to download updates, using wget, which at present is in usr/local/bin. How do I get that directory on the equivalent of the DOS path (what is that in BSD?) Or should I move wget to another directory?

TIA,
Mark
 
The form for the path depends on the shell you're using. If you use bash (default in 10.3) add this to .bash_profile or .bashrc in your home directory:
PATH="${PATH}:/usr/local/bin"
If you use tcsh (default in 10.0 - 10.2), add this to your .tcshrc :
set path = ( ${path} /usr/local/bin )
 
OK. I think in fact the file I need to edit is .profile. The other 2 weren't there. I'm in 10.3, using bash. What editor would you recommend? I'm not familiar with vim.
 
if .bashrc isn't in your Home Folder, create a new file.
If you don't know what the hell you're doing in vim or emacs, try pico.

Another simpler single command which would work would be
Code:
echo "PATH=\"\$[PATH]:/usr/local/bin\"" >> ~/.bashrc

which will append (>>) the string PATH="$[PATH]:/usr/local/bin" to the ~/.bashrc file. If it doesn't exist, it will create it. the back-slashes "escape" the characters $ and " so echo doesn't try to resolve them.
 
I used emaces and added that line (PATH="${PATH}:/usr/local/bin") to ~/.profile. Now wget is accessible from terminal. Thanks for the help.

I tried out pico as well. It look easier to get into than emacs.
 
Back
Top