Sorry for the confusion, but I'm totally confused.
What do I do? I tried the single statement with
"echo" and the word "export" showed up in my .bashrc
file for some reason.
I've never done any of this before, and I've been
given 3 files to create, with 2 ways of exporting to
such a file. Can we focus on one way of doing
things, to make it clear?
When a bash shell starts up, it reads several startup files: .bashrc, .bash_profile, and possibly .profile and .login. (I have no idea why there are so many options; personally, I use the /bin/tcsh shell and put all of my startup command in a .cshrc file.)
In any case, you should be fine putting these commands in either .bashrc or .bash_profile. First, let me break down the echo command that was recommended to you:
echo "export PATH=\"/usr/local/bin:$PATH\"" > .bash_profile
First, as you probably guessed, echo just repeats its argument, evaluating any shell variables. If you had just typed
echo "export PATH=\"/usr/local/bin:$PATH\"", then the quoted string would have just been printed out to the terminal. However, the '>' is the redirect operator, and it sends the output from a command to a file, in this case .bash_profile. (One thing to note is that using '>' will overwrite an existing file; it's often better to use the '>>' operator instead, which just appends the output to the end of the existing file.)
Back to solving your problem: open up .bash_profile in a text editor. (If you're using TextEdit, you can do this at the command line with "open -a /Applications/TextEdit.app ~/.bash_profile".) Add the line:
export PATH="/usr/local/bin:$PATH"
to the file. Save the file and open up a new terminal, then type "echo $PATH" to see if it worked correctly.
MacBook C2D (home), PowerMac Dual G5 (work) Mac OS X (10.4.10)