2

When I open a new terminal, I get the following:

Last login: Sun Jun  1 16:39:07 on ttys000
-bash: Setting: command not found
NAME-OF-COMPUTER-MacBook-Pro:~ name$ 

I am used to seeing the first and the third lines, but the second seems new. How do I fix this?

EDIT

After executing bash -x -l as Ian C. requested, this is the output:

+ '[' -x /usr/libexec/path_helper ']'
++ /usr/libexec/path_helper -s
+ eval 'PATH="/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/local/git/bin:/Library/Frameworks/Python.framework/Versions/3.4/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin";' export 'PATH;'
++ PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/local/git/bin:/Library/Frameworks/Python.framework/Versions/3.4/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin
++ export PATH
+ '[' /bin/bash '!=' no ']'
+ '[' -r /etc/bashrc ']'
+ . /etc/bashrc
++ '[' -z '\s-\v\$ ' ']'
++ PS1='\h:\W \u\$ '
++ shopt -s checkwinsize
++ '[' Apple_Terminal == Apple_Terminal ']'
++ '[' -z '' ']'
++ PROMPT_COMMAND='update_terminal_cwd; '
+ Setting PATH for Python 2.7
bash: Setting: command not found
+ PATH=/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/local/git/bin:/Library/Frameworks/Python.framework/Versions/3.4/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin
+ export PATH
+ PATH=/Library/Frameworks/Python.framework/Versions/2.7/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/local/git/bin:/Library/Frameworks/Python.framework/Versions/3.4/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin
+ export PATH
+ PATH=/Library/Frameworks/Python.framework/Versions/2.7/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/local/git/bin:/Library/Frameworks/Python.framework/Versions/3.4/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin
+ export PATH
+ PATH=/Library/Frameworks/Python.framework/Versions/3.4/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/local/git/bin:/Library/Frameworks/Python.framework/Versions/3.4/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin
+ export PATH
++ update_terminal_cwd
++ local 'SEARCH= '
++ local REPLACE=%20
++ local PWD_URL=file://Conner-Pikes-MacBook-Pro.local/Users/connerpike
++ printf '\e]7;%s\a' file://Conner-Pikes-MacBook-Pro.local/Users/connerpike

Also, Do I need those four long lines for something that has to do with python? It looks unnecessary. Any help on that would be much appreciated also.

1 Answer 1

2

Something in your startup files is trying to call a command called Setting which isn't a command that exists. You can debug your start up files by running:

bash -x -l

and watching the output -- you'll see all the commands that are being run on startup and hopefully spot the line where Setting is trying to be used as a command. If you want to post your startup files more help might be possible.

What do you mean by "startup files"?

When your bash shell starts, it reads and executes a bunch of standard startup files to setup your environment. It usually starts with /etc/profile and then everything in the /etc/profile.d/*.sh directory. Then it moves on to the user-level ~/.bash_profile and ~/.bashrc files.

Based on the output you posted your problem is here:

++ '[' -z '' ']'
++ PROMPT_COMMAND='update_terminal_cwd; '
+ Setting PATH for Python 2.7
bash: Setting: command not found

You have the literal line:

Setting PATH for Python 2.7

in one of the startup files. It should either be prefixed with echo or commented out with a # character.

Try and find the file by running these commands in a Terminal:

grep -H Setting /etc/bashrc /etc/profile ~/.bash_profile ~/.bashrc

From the depth marker, the single + in that output, it's in a top-level file, not something being sourced from one of them.

If that grep command matches it'll print the file name. Find the line and add a # to the front of it to comment it out. For example, change:

Setting PATH for Python 2.7

to:

# Setting PATH for Python 2.7

in the file where grep reports the line.

1
  • What do you mean by "startup files"? I have edited my post with the output from bash -x -l
    – Will Pike
    Commented Jun 2, 2014 at 1:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .