[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Package organization issue...



(I hope you don't mind that I posted this to debian-devel too, it may be of
general interest.)

Lars Wirzenius:
> Joey Hess:
> > Redhat already does something like this. It seems to work for them..
> > They call the directory /etc/profile.d/ .
> 
> Do you happen to know what they do to support users of tcsh, and
> other non-Bourne shells?

I did some more poking around on the only redhat machine I have an account
on. /etc/profile contains:

for i in /etc/profile.d/*.sh ; do
        if [ -x $i ]; then
                . $i
        fi
done

Sourcing the files like this is obviously better than Nico's idea of having the
scripts echo the commands they want run.

And /etc/csh.cshrc has:

test -d /etc/profile.d
if ($status == 0) then
        set nonomatch
        foreach i ( /etc/profile.d/*.csh )
                test -f $i
                if ($status == 0) then
                        source $i
                endif
        end
        unset nonomatch
endif

So there are two copies of each script, one for sh and one for csh.
Presumably, the sh ones should be written portable enough so that zsh, etc
could use them too. If there are other non-compatable shells that should be
supported, we just add a new set of scripts with a new extention.

-- 
See shy Jo.


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-devel-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .


Reply to: