etc/setenv/sh

30 lines
592 B
Text
Raw Normal View History

2020-11-04 02:03:20 +03:00
# To include in any rc to set up the environment by files.
if test -n "$rpath" ; then
export SETENV="$rpath/dot/setenv"
fi
setenv(){
if [ -d "$ENVDIR" ] ; then
# The way to make system more flexible.
# Actually I'm really tired of editing one big file.
# It is really easier to change specific one with variables
# or modules.
# Set variables from files.
sh="$1"
for i in "$ENVDIR/$sh/var"/* ; do
2020-11-04 02:03:20 +03:00
if test -r "$i" ; then
export "`basename \"$i\"`"="`cat \"$i\"`"
fi
done
# Modules.
for i in "$ENVDIR/$sh/rc"/*; do
2020-11-04 02:03:20 +03:00
if test -r "$i" ; then
. "$i"
fi
done
fi
}