OSX Leopard – PATH change doesn’t persist

mac-osxpath

I tried to change the $PATH using the following command:

export PATH=/opt/subversion/bin:/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/git/bin

(i use the full variable because concatenating duplicated stuff or something)

However, on another terminal

echo $PATH

doesn't show the change (i've added the /opt/subversion/bin).

I read here:
http://www.tech-recipes.com/rx/2621/os_x_change_path_environment_variable that
I should run

. ./.profile

But I get

-bash: ‘export: command not found

error on this command (I was on the home directory, after running 'cd').

Tried also to log off and on, no trace for the subversion I added to the path.

Have I missed something? Thanks.

Best Answer

Seems like something is wrong with the .profile file, there should be any sort of single quote before the export (See bash your error). I can't think of how that got there right now, but check the file for any strange character with cat -vE ~/.profile (Which hopefully works in OS X).