Should the .bashrc in the home directory load automatically?
bash, macos
Solution
Your shell is probably a login shell, in which case bash will read various profile files in order:
- `/etc/profile`
- `~/.bash_profile`
- `~/.bash_login`
- `~/.profile`
It's typical to source `~/.bashrc` from one of those files so you get the same config for login shells as well.
This is what my `~/.profile` contains:
# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.
# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022
# if running bash
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
fi
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
export LANGUAGE="en_US:en"
export LC_MESSAGES="en_US.UTF-8"
export LC_CTYPE="en_US.UTF-8"
export LC_COLLATE="en_US.UTF-8"
Problem
I added scala in my .bashrc file, but when I shut off my mac and turn it back on it does not find it. When i do ``` source ~/.bashrc ``` all is back to normal. I would say the issue is with the whole file in general, but the problem, is I have other things in there that have worked just fine before, but the problem is persistent with scala. Anybody know why this is and explain why I am getting the problem? This is whats in my .bashrc file, which runs rvm and mysql correctly, but not scala: ``` PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting export PATH="/usr/local/mysql/bin:$PATH" export PATH="/Users/Zeroe/scala-2.9.1-1/bin:$PATH" ```