|
|
HELP! I screwed up my PATH!
|
|
|
|
Forum Regular
Join Date: Aug 2006
Status:
Offline
|
|
Hi,
I was following the instruction to install MySQL. I exported mysql into PATH.
MySQL work in the terminal windows but all other commends stoped working, so I did this: export PATH=$PATH:/bin:/usr/bin:/sbin:/usr/sbin
to restore the PATH, it worked when I was still in terminal, I could use ls, cp... commands again. But the problem is that when I quit the terminal then restart it again, In Darwin it says -bash export:`/bin:/usr/bin: /sbin:/usr/sbin':not a valid identifier. When I type ls, I get this error, -bash I command not found.
What's going on there?
By the way, I use a G$ Mac min, OSX 10.4.8.
Thanks in advance
MacPC
|
|
|
|
|
|
|
|
|
Posting Junkie
Join Date: Nov 2000
Location: in front of my Mac
Status:
Offline
|
|
If you put the export PATH statement into your .bashrc or .bash_profile file it should work in every new bash session.
|
•
|
|
|
|
|
|
|
|
Forum Regular
Join Date: Aug 2006
Status:
Offline
|
|
Thanks.
I actually went into the ~/.bash_profile and edited it with this line:
PATH:/usr/bin:/bin:/xyz...:$PATH. Now everything is back to normal except when I open terminal, under Darwin it still says export: `/usr/bin:/bin:.....':not a valid identifier. How do I get rid of this message?
MacPC
|
|
|
|
|
|
|
|
|
Posting Junkie
Join Date: Nov 2000
Location: in front of my Mac
Status:
Offline
|
|
Hmm, I'm not sure.
What happens if you use this line instead:
PATH = $PATH:/bin:/usr/bin/:/sbin:/usr/sbin
And BTW, are you sure those paths all exist on your Mac?
|
•
|
|
|
|
|
|
|
|
Professional Poster
Join Date: Oct 2001
Status:
Offline
|
|
Add the following near the top of your .bashrc file in your home folder and you should be set for life (unless you decide to install fink):
code:
export PATH=/bin:/sbin:/usr/local/mysql/bin:/usr/bin:/usr/sbin:/usr/X11R6/bin:/usr/local/bin:/Developer/Tools
Note: That should be one single line with only one single space after 'export'.
|
|
|
|
|
|
|
|
|
Forum Regular
Join Date: Aug 2006
Status:
Offline
|
|
Hi, Thanks again for the replies.
Yes Simon, I do have quit long list in the PATH. and itistoday, for some reason in my home directory, it doesn't have the ~/.bashrc file, it has bash_profile and bash_history so I created a bashrc and typed in the code, but I am still getting the same error msg in Darwin. Where does this msg come from anyway?
MacPC.
|
|
|
|
|
|
|
|
|
Professional Poster
Join Date: Oct 2001
Status:
Offline
|
|
Hmm... Make sure PATH is not being set anywhere else. Also, instead of doing:
code:
export PATH=$PATH:/bin:/usr/bin:/sbin:/usr/sbin
Try:
code:
export PATH=/bin:/usr/bin:/sbin:/usr/sbin:$PATH
|
|
|
|
|
|
|
|
|
Posting Junkie
Join Date: Nov 2000
Location: in front of my Mac
Status:
Offline
|
|
If you don not have a ~/.bashrc file, you can also put the command in ~/.bash_profile. I don't know if just dumping the command in a ~/.bashrc file will work. My ~/.bash_profile explicitely calls ~/.bashrc. Does your's do that to? If not, add something like this to ~/.bash_profile:
code:
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
|
•
|
|
|
|
|
|
|
|
Forum Regular
Join Date: Aug 2006
Status:
Offline
|
|
Hi,
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
When I dump this code in the ~/.bash_profile, Terminal gives me another line of error msg.
I was looking through all the bash related files,
In the /etc/bashrc, I have
# System-wide .bashrc file for interactive bash(1) shells.
if [ -n "$PS1" ]; then PS1='\h w \u\$ '; fi
# Make bash check it's window size after a process completes
shopt -s checkwinsize
Not sure what this does.
In my /etc/profile I have
# System-wide .profile for sh(1)
if [ "${BASH-no}" != "no" ]; then
[ -r /etc/bashrc ] && . /etc/bashrc
fi
Not sure what this does either.
I think the error msg has to do with one of the above files.
In my ~/.bashrc I have
export PATH=/usr/local/mysql/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/X11R6/bin:/Developer/Tools: $PATH
and in my ~/.bash_profile I have
export PATH=/usr/local/mysql/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/X11R6/bin:/Developer/Tools: $PATH
same as ~/.bashrc.
There is also a .bash_history in the /Users?myusername/ but it's blank.
Do they look normal to you guys?
MacPC.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Forum Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|