yeah, i found that stuff in /etc/profile.d once when i was setting an environ 
var in /etc/profile and wondering why it was being overwritten.

thats cool, putting echos in those files to see when they run, but i'd still 
like to know >where< all the other environment vars are being set.

are environ vars set >only< in shell scripts?  or are there other things (i 
dunno, like the kernel at boot time?) that can set environ vars?  i've 
>never< seen the PATH var set without including itself in the definition 
(i.e. PATH=$PATH:/blah/blah).  it must be set for the first time somewhere, 
right?

thanks for the help.

On Sunday 10 December 2000 22:07, you wrote:
> 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



_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to