Quote:
Originally Posted by
bodisha
Thanks for the quick reply! I'm still unclear on a few points and I hope you don't mind a follow up question to straighten me out
To address your first comment about "they do whatever their author wanted"... When inspecting the files in question I noticed the comment "Functions and aliases go in /etc/bashrc" in the /etc/profile file
That's just someone arranging their own house as suits themselves, /etc/bashrc is something they invented. Maybe they wanted to put special BASH-only syntax in it, or maybe they worried about the system automatically replacing /etc/profile (which a few systems do).
Quote:
Based on some of the posts I've read while researching the subject... I got the impression certain files had very specific purposes... And I've even seen posts were people were saying builtin commands (like umask) wouldn't work in certain files... Can you confirm this?
I can confirm that it's what I described in my earlier post and absolutely nothing more. umask is not blocked.
The only "mystery" is when it's being run in the same shell, versus when you're running it in a different shell, and if you understand that
./scriptname creates a new process while
. scriptname doesn't, you've already grasped the entire issue.
All profile files are executed in the current shell, by the way, they wouldn't be much use if they weren't.
Quote:
If so I'm trying to understand the exact rules surrounding which sort of functionality the individual startup files can support
Functionality is never limited (not unless you start
asking it to limit things with funny flags like bash -r).
Quote:
"/etc/bashrc is not a file bash will load unless something else tells it to, but someone could easily have put /etc/bashrc into /etc/profile"
While trying to understand this topic I edited each file and put echo commands in the individual files to see when they'd start. The /etc/bashrc started in both login and non-login shells. It loaded after the /etc/profile in a login shell (putty) and in the non-login shell (The gnome GUI terminal) when the /etc/profile didn't run.
Are you sure?
grep /etc/bashrc /etc/profile
Quote:
I looked through the profile and all the scripts under the /etc/profile.d directory and couldn't locate anything calling the /etc/bashrc script. Could I ask you for a clue on where else I might look to see what's starting it?
Any other file these scripts read could be invoking it. If you could post the content of your ~/.bashrc and /etc/profile, we can suggest where to look next. Be sure to put them in code tags.
It's
possible they customized BASH itself to use a different profile file, but I'm not sure why they'd bother... It's trivial to just dump a
. /etc/bashrc into your ~/.bashrc