Peter
Your
/etc/profile is OK (I had to mount a 10.3.9 volume to check, because it has changed slightly in 10.4).
The big space between the profile command and the result was the way it displayed in my terminal window.
That's normal for
more or
less when the file is shorter than the Terminal window—it will fill to the bottom.
Somewhere your path is being wrongly set. Obviously, someone wanted to
add
".:/usr/local/bin" to your path, but instead is overwriting it. The first thing to note is that adding '.' to your path is a security risk. If you really must have it, you should put it at the end. I never use it: I have a ~/bin directory for my own private stuff and add that to my path instead.
Now to this path corruption. First, move ~/Library/Preferences/com.apple.Terminal.plist to your Desktop, restart Terminal and repeat the
echo $PATH command. If it has changed, post back to let us know the new value.
If it is unchanged, you can put that .plist back and restart Terminal again. Now you need to check the other files that
bash reads on startup. After
/etc/profile, it looks for, and executes the first one that exists, out of
~/.bash_profile,
~/.bash_login, and
~/.profile in that order. You should also check for
~/.bashrc, since this is run for a second and subsequent Terminal window, and is often sourced from one of the others.
You need to look for a line that says
export PATH=".:/usr/local/bin"
and change that to
export PATH="$PATH:/usr/local/bin/."
where I have added '.' as the
last item in the path (safest place for it) but would urge you to leave that out.