The source of the problem is in the file originally located at "~/.bash_profile". Its contents were:
Code:
export PATH="/usr/local/mysql/bin:$PATH"
source ~/.bash_profile
mysql -v
The specific problem is in line 2. It tells the shell to read from "~/.bash_profile", i.e. it tells the shell to read commands from itself. The shell will do this, then encounter yet another command to read from "~/.bash_profile", which leads to yet another command to read from "~/.bash_profile", which leads to... infinite recursion.
I'm not going to experiment to discover what eventually limits this infinite recursion, but based on your earlier post it takes about 15 seconds to hit that limit. At that point the shell terminates.
Looking at the linked tutorial, I searched for the word "source".
Reading a few paragraphs there, it looks like your mistake arose here:
Exit the file with type “control + x” and when prompted save the change by typing “y”.
That is, when you're editing ~/.bash_profile, it should contain exactly one line:
Code:
export PATH="/usr/local/mysql/bin:$PATH"
You should then SAVE the file and EXIT the nano editor. At that point you'll be back at the shell prompt. THAT'S where you execute the next two commands:
Code:
source ~/.bash_profile
mysql -v
That is, DO NOT put those two lines into "~/.bash_profile".
The original "~/.profile" appears to be fine. You can copy it back into place with this command:
Code:
cp ~/bad/profile ~/.profile
I don't think it will matter, because bash won't use it. From the bash man page:
When bash is invoked as an interactive login shell, or as a non-inter-
active shell with the --login option, it first reads and executes com-
mands from the file /etc/profile, if that file exists. After reading
that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile,
in that order, and reads and executes commands from the first one that
exists and is readable. ...
If you're still using MacPorts, then you'll need to reconcile ~/.bash_profile with ~/.profile.