1

I just got this really weird problem. When I start bash, I get these two lines:

-bash: fasd: kommandot finns inte
-bash: brew: kommandot finns inte

"kommandot finns inte" means command does not exist in Swedish (the more you know!). Also, my prompt is not colored and what not. Most of this seems to be resolved as soon as I type

source ~/.bash/profile

Another weird thing is that I suddenly can't get colors with

ls -G

although when I rename my .bash_profile this goes away (the ls -G thing).

None of this was a problem a very short time ago.

The last few days I have configured my dotfiles. The major things I did was to move many of them (~/.bash_profile, ~/.bash_prompt, ~./aliases, etc.) to a dotfiles folder and symlink them to the home folder. I also installed a bunch of stuff with homebrew. My dotfiles' github repo is here.

I'm really confused right now, help is very appreciated!

  • Can you add a ls -la from your home? And a file ~/.bash_profile? – ott-- Aug 11 '15 at 18:29
  • Do you meen that I should paste it here? – Mattias Aug 11 '15 at 18:34
  • The files starting with dot are enough. – ott-- Aug 11 '15 at 18:35
  • Just look in my github repo I linked to. – Mattias Aug 11 '15 at 19:23
  • This doesn't help much. I need to see the symlinks in action. And normally, .bash_profile sources .bashrc, not vv. – ott-- Aug 11 '15 at 19:51
1

You should have .bash_profile and .bashrc at least and may have .profile, .bash_aliases, .bash_logout and many, many other files in your home directory that affect bash. The exact structure of such files changes with the OS and personalization by the user.

For a full answer you need to provide the full output of ls ~/.bash* and if ~/.profile or ~/.environment exist, at the very least.

It will help if you read: Choosing, Difference, Start up, and specially Order. That will clarify the difference in which files are loaded for an interactive shell, a login shell and for scripts.

After that, you need to check that all relevant file links are in place.

And note that an existing ~/.bash_login will prevent the loading of ~/.bash_profile, for example.

Then, for your specific OS (OS X) read this. It is not perfect, but it shows: how the user has inserted if [ -f ~/.bashrc ]; then . ~/.bashrc; fi in the ~/.bash_profile file to ensure that ~/.bashrc is loaded.

So: this is not a simple answer, but the shell startup setup is never simple.
Do look inside the files to find which file loads what.

1

I am stupid... The problem was the exports. I forgot that I moved the definition of /usr/local/bin in PATH to ~/.exports from /etc/paths. All I had to do was source the ~/.exports first in ~/.bash_profile.

The ls color problem was from GNU core utilities that I installed via homebrew. Apparently it doesn't support the G flag, like os x's ls does.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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