I noticed that you can prevent reading /etc/profile by running
bash --noprofile
However this also stops ~/.bash_profile from being read. Can Bash be invoked in such a way as to read ~/.bash_profile but not /etc/profile?
Try the options --noprofile and --rcfile file_name where file_name is the config file you want read, e.g:
bash --noprofile --rcfile ~/.bash_profile
Well... somebody didn't like this answer, but it appears to be exactly what was desired:
--noprofile causes all normal rc files to not be read.
--rcfile <some file> causes the specified file to be read instead. This can certainly be the user's .bash_profile as requested.
You can simply do add in ~/.bashrc file
if [ -f ~/.bash_profile ]; then
. ~/.bash_profile
fi
The login shell will always read /etc/profile, which allows the system admin to set environment variables and paths for all users.
If you are the only user and this is your system you are free to edit or remove /etc/profile if you wish.