alli alli - 4 months ago 23
Bash Question

bash profile error: not a valid identifier

Whenever I open my bash profile I am immediately greeted with:

Last login: Wed Jul 27 11:41:49 on ttys000
-bash: PATH: command not found
-bash: export: `“/Users/allisondavis/Documents/HCl/sfit4/pbin/Layer0:/Users/allisondavis/Documents/HCl/sfit4/pbin/Layer1:/Users/allisondavis/Documents/HCl/sfit4/pbin/ModLib:/Users/allisondavis/Documents/HCl/Pythonstuff”': not a valid identifier
~.bash_profile


Here is my bash profile:

PATH="~/bin:/usr/bin:${PATH}"
export PATH
PATH = “/Users/allisondavis/Documents/HCl/sfit-ckopus”
export PATH
export PATH PYTHONPATH= “/Users/allisondavis/Documents/HCl/sfit4/pbin/Layer0:/Users/allisondavis/Documents/HCl/sfit4/pbin/Layer1:/Users/allisondavis/Documents/HCl/sfit4/pbin/ModLib:/Users/allisondavis/Documents/HCl/Pythonstuff”
export PYTHONPATH

PATH=${PATH}:${PYTHONPATH}
export PATH


echo '~.bash_profile'
# Setting PATH for Python 3.5
# The orginal version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.5/bin:${PATH}"
export PATH


Any idea what the problem is?

Answer

You have a couple problems there. The one giving you the error there is the quotes you're using: “foo” should be "foo".

Your next issue is that you'll be losing your original path through the options there. You probably want something like:

PATH="$HOME/bin:/usr/bin:${PATH}";
PATH="/Users/allisondavis/Documents/HCl/sfit-ckopus:${PATH}";
PATH="/Library/Frameworks/Python.framework/Versions/3.5/bin:${PATH}";
export PATH;

PYTHONPATH="/Users/allisondavis/Documents/HCl/sfit4/pbin/Layer0:/Users/allisondavis/Documents/HCl/sfit4/pbin/Layer1:/Users/allisondavis/Documents/HCl/sfit4/pbin/ModLib:/Users/allisondavis/Documents/HCl/Pythonstuff:${PYTHONPATH}";
export PYTHONPATH;

You also cannot use ~ to refer to home when assigning PATH, instead you should be using $HOME.