#!/usr/bin/sh # # ADD.MODULES, Adds $ETC/*.modules to the $HOME/.login, .cshrc, .profile, # .bashrc & .kshenv # Copyright (C) 2000-2017 R.K. Owen # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . ########################################################################## VERSION='$Id: 196cf1d4fbd7d3deecf648e85ee37ead75a60a93 $' SKEL=/etc/skel ETC=/skel /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