#!/bin/sh # # Adds $ETC/*.modules to the $HOME/.login, .cshrc, .profile, .bashrc & .kshenv # #set -x VERSION='$Id: add.modules.in,v 1.1.1.1 2000/06/28 00:17:33 rk Exp $' 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