4
4
A bash user will eventually end up with .bashrc
, .bash_profile
, .profile
, and maybe some more.
Now, each file gets loaded unders particular situations, and it all leads to confusion and frustration. I don't care about what shell is a login shell and neither should you.
I just want to make sure the same thing is loaded for every shell thing that happens.
So, what's the sane way to set them up?
I'd wager non-bash-specific things go into .profile
, and some file sources the others, etc. What exactly would in put in each to achieve an identical environment for every shell?
Note: I'm not asking what you particularly enjoy putting in your rc files, like aliases and functions and so on. Just how you lay them out so as not to have things randomly spliced amongst them.
I have this awesome book, From Bash to Z Shell, and I used to know just the perfect way to get out of shell initialization hell, but it's all messy and random, and, well, I can't remember things that don't make sense. – kch – 2009-08-06T08:05:21.293
But some commands, if executed in a non-terminal holding shell, can make logging into that account impossible. – Kent Fredric – 2009-08-06T08:10:02.953
1I'd love an example. Anyway, I'm sure in that case it can be left off in the appropriate file so as not to run when it shouldn't. – kch – 2009-08-06T08:11:30.733
One example would be problems with rsync: http://www.samba.org/rsync/FAQ.html#3
– innaM – 2009-08-06T09:54:03.093