Forum OpenACS Q&A: Re: Use /etc/

Posted by Andrew Piskorski on
Oh, Red Hat seems to have /etc/profile.d/ as well, I didn't know about that. Debian does not though. Ah, it is used via a little loop at the end of /etc/profile:
for i in /etc/profile.d/*.sh ; do
    if [ -r "$i" ]; then
        . $i
unset i
So that's good, there's no magic going on behind the scenes, it is just good old /etc/profile doing the work. Very simple.

(I guess nobody in the Linux world worries about /bin/sh vs. /bin/bash differences anymore, since most Linux distributions use bash for everything. That "; then" syntax won't work in sh, like you sometimes find on Solaris...)