#! /bin/sh # # Adds $ETC/*.modules to the $HOME/.login, .cshrc, .profile, .bashrc & .kshenv # # etc/add.modules. Generated from add.modules.in by configure. # VERSION='$Id: 196cf1d4fbd7d3deecf648e85ee37ead75a60a93 $' SKEL=/etc/skel ETC=/etc /bin/cat < $2 } # find if certain of the dot files have load lines already findload() { grep "^[ ]*module[ ]*load" $1 > /tmp/load.$$ } # put common stuff derivatives here $1=.dot_file $2=action $3=shell(csh,sh) $4=skel alternative shdot() { if [ -f $1 ] then /bin/cat < $1 <> $1 else /bin/cat >> $1 <> $1 < $1 <> $1 else /bin/cat >> $1 <> $1 <> $1 && /bin/rm /tmp/$1.$$ elif [ x$2 = xalias ] then /bin/cat < $1 < $1 <> $1 && /bin/rm /tmp/$1.$$ fi else /bin/echo "Had problems with your $1" fi else /bin/cat < /dev/null } # process files in $HOME cd $HOME if [ -r .bash_profile ]; then shdot .bash_profile source sh $SKEL/.profile fi if [ -r .bash_login ]; then shdot .bash_login source sh $SKEL/.profile fi shdot .profile source sh $SKEL/.profile shdot .bashrc alias sh $SKEL/.kshenv shdot `basename ${ENV:=.kshenv}` alias sh $SKEL/.kshenv shdot .login source csh $SKEL/.login shdot .cshrc alias csh $SKEL/.cshrc exit