For some reasons i always get the following whenever i log into my terminal:

: command not found
: command not found
: command not found
: command not found
: command not found

It's really a minor problem because everything is working fine, or at least everything what im using in the terminal. Still it would just look nicer without them. Any help?

I'm running Mac OS 10.5.8 <= if this helps solving the problem

link|improve this question
feedback

migrated from stackoverflow.com Apr 20 '10 at 14:02

This question came from our site for professional and enthusiast programmers.

2 Answers

You probably have some garbage in your .login or .profile.

link|improve this answer
feedback

Places to look:

  • System shell startup files -- /etc/profile, /etc/bashrc
  • Personal startup files -- $HOME/.profile, $HOME/.bashrc, $HOME/.bash_profile

(this all assumes you're using bash as your shell)

Try running the scripts using the -x option to show the commands and their output to help you identify the troublesome lines:

$  bash -x /etc/bashrc
+ '[' -z '' ']'
+ return
/etc/bashrc: line 3: return: can only `return' from a function or sourced script
+ PS1='\h:\W \u\$ '
+ shopt -s checkwinsize

The lines preceded by + show the commands which will be executed. Output (if any) is shown in between.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.