christopher j bottaro <[EMAIL PROTECTED]> writes:
> weeeeeee, i like mailing lists. i have so many questions!
>
> i know at some point, these shell scripts are executed in this order...
>
> /etc/profile
> /etc/bashrc
> ~/.bash_profile
> ~/.bashrc
>
> but when i type "set" i see many more environment vars than i saw were set
> and exported in those 4 files. where are the rest coming from? are there
> any other shell scripts besides those four that are executed at login? also,
> what scripts are run when you spawn a new shell (aka, start a shell thats not
> the login shell).
Here is a little exercise I had fun with when wondering the same
stuff.
Put lines like these in the various files
in /etc/profile put:
echo "Tally Ho .... and away we go... /etc/profile"
In /etc/bashrc
echo "/etc/bashrc .. reporting for duty sir"
In ~/.bashrc
echo " Now what... ~/.bashrc"
In ~/.bash_profile
echo " waaazzzzup dude! ~/.bash_profile ... getting down"
Of course you can get a lot more inventive
The idea is, when you take various actions you will know immediately
what files were called. Its one way to know for sure.
Some of the init files have clauses that `source' others and etc so it
can get pretty confusing
Once you see what gets called its best to comment out or remove the
lines because it can cause problems on remote logins with rsync (ssh)
or other apps.
Now about where it is coming from... I think most is from those 4
files unless you may have a~/.login file in place.
But a second source for some things is /etc/profile.d/*.sh
Look in /etc/profile for code that steps thru those files. Something
like:
for i in /etc/profile.d/*.sh ; do
if [ -x $i ]; then
. $i
fi
done
unset i
That code looks to see if there are any executable files under
/etc/profile.d and if there are they get called. Quite a bit of
stuff in there.
_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list