From my bash shell (latest version of Lion) if I issue the command...

source ~/sh/bashmarks.sh

The bashmarks.sh script will run and the functionality it provides is available. However I don't want to manually run this script so I have tried to put it into my ~/.bash_profile (the above command is the only thing in the file).

If I quit Terminal and then restart it, the ~/.bash_profile runs, but it reports...

: command not found

How can I get the commands contained in this script to run when the Terminal is opened? I know the correct .bash_profile is being run, because I can modify the file with some other commands and those don't work either, but the point being is I can see the output change when I modify the contents of the file and restart the shell. So it is picking up the right ~ user directory (I am the only account on the machine).


Does your .bash_profile have DOS-style line endings? Strange error messages like that often are "corrupted" by a \r character.

  • Thanks, that was it! I think I originally edited this file from the Windows side, and was subsequently editing from the Mac side, but there must have been some leftover control characters. – John Livermore Jun 11 '12 at 23:24

You must log in to answer this question.

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