I was adding a $PATH to .bash_profile:
PATH="/Applications/MAMP/bin/php/php5.3.6/bin:$PATH"
So I could install PEAR on MAMP. That all worked, but now I have an this error each time I start up:
-bash: export: `/usr/local/bin': not a valid identifier
I tried a lot of solutions from people with similar problems, such as:
I messed up my bash configuration on mac
These are the files possibly containing the problem:
/etc/profile
# System-wide .profile for sh(1) if [ -x /usr/libexec/path_helper ]; then eval /usr/libexec/path_helper -s` fi if [ "${BASH-no}" != "no" ]; then [ -r /etc/bashrc ] && . /etc/bashrc fi`
/etc/paths
/usr/bin
/bin
/usr/sbin
/sbin
/usr/local/bin
~/.profile
export PATH="/usr/bin:/bin:/usr/sbin:/sbin:$PATH"
~/.bash_profile
#export PATH="/usr/bin:/bin:/usr/sbin:/sbin:$PATH"
launchctl export
PATH="/usr/bin:/bin:/usr/sbin:/sbin"; export PATH;
TMPDIR="/var/folders/9l/7n7rrkrj0d51ydll3hb3l8780000gn/T/"; export TMPDIR;
SHELL="/bin/bash"; export SHELL;
HOME="/Users/XXXXXX"; export HOME;
USER="XXXXXX"; export USER;
LOGNAME="XXXXXX"; export LOGNAME;
SSH_AUTH_SOCK="/tmp/launch-d3uaRv/Listeners"; export SSH_AUTH_SOCK;
Apple_Ubiquity_Message="/tmp/launch-YdytLh/Apple_Ubiquity_Message"; export Apple_Ubiquity_Message;
Apple_PubSub_Socket_Render="/tmp/launch-8QgJZ0/Render"; export Apple_PubSub_Socket_Render;
DISPLAY="/tmp/launch-c6nAQC/org.macosforge.xquartz:0"; export DISPLAY;
printenv
TERM_PROGRAM=Apple_Terminal
TERM=xterm-256color
SHELL=/bin/bash
TMPDIR=/var/folders/9l/7n7rrkrj0d51ydll3hb3l8780000gn/T/
Apple_PubSub_Socket_Render=/tmp/launch-8QgJZ0/Render
TERM_PROGRAM_VERSION=309
TERM_SESSION_ID=8336481B-7483-4050-919F-1268887775DE
USER=XXXXXX
COMMAND_MODE=unix2003
SSH_AUTH_SOCK=/tmp/launch-d3uaRv/Listeners
__CF_USER_TEXT_ENCODING=0x1F5:0:0
Apple_Ubiquity_Message=/tmp/launch-YdytLh/Apple_Ubiquity_Message
PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:
PWD=/Users/XXXXXX
SHLVL=1
HOME=/Users/XXXXXX
LOGNAME=XXXXXX
LC_CTYPE=UTF-8
DISPLAY=/tmp/launch-c6nAQC/org.macosforge.xquartz:0
_=/usr/bin/printenv
OLDPWD=/Users/XXXXXX
Files in '/etc/paths.d/':
40-XQuartz
/opt/X11/bin
I dont have a bashrc directory at location /etc/bashrc.
I also don't have ~/.bashrc.
Maybe it is also useful that before I installed PEAR I added a symlink to /usr/bin maybe that is part of the problem?
.bash_profile? You can copy and past the result ofcat ~/.bash_profile– Maverik Oct 10 '12 at 13:49~/.profileempty? Please try to comment the line you added in~/.bash_profileand copy and paste the result ofecho $PATH– Maverik Oct 10 '12 at 14:02echoif your$PATHis empty? – Maverik Oct 10 '12 at 14:21/usr/binshould be in your$PATH, as well as/bin:/usr/sbin:/sbin– Maverik Oct 10 '12 at 14:26PATHby adding to.bash_profilethe lineexport PATH=/usr/bin:/bin:/usr/sbin:/sbin:$PATH– Maverik Oct 10 '12 at 14:29/bin/mv .bash_profile bash_profile_disabled– bottleboot Oct 10 '12 at 14:52.bash_profile, do you still have to do/bin/mvfor moving a file or you can just usemv? If not, there is something wrong, because all the "shell commands" likemvare in\binwhich should be in your$PATH– Maverik Oct 10 '12 at 15:00.bash_profileI can still usemvorlsetc – bottleboot Oct 10 '12 at 15:08$PATHcannot be empty, however when you call the commandmvfrom a directory different than/bin, it should return-bash: mv: command not found– Maverik Oct 10 '12 at 15:11/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:– bottleboot Oct 10 '12 at 15:14.profile. Now try to add the line I put in my answer to the file.profileand thanecho $PATH– Maverik Oct 10 '12 at 15:19$PATHis still returning the same thing – bottleboot Oct 10 '12 at 15:33/etc/paths, each file in/etc/paths.d/,/etc/bashrc,~/.profile,~/.bash_profile,~/.bashrcand the output oflaunchctl exportandprintenv? Do you use macports? – Percival Ulysses Oct 12 '12 at 15:17~/.bash_login, if there is such a file. Right now, are there any problems? The only strange thing that I see that the PATH in printenv should be grander because of the stuff in~/.profile. – Percival Ulysses Oct 12 '12 at 16:28