sh 593 B

1234567891011121314151617181920212223242526272829
  1. # To include in any rc to set up the environment by files.
  2. if test -n "$rpath" ; then
  3. export SETENV="$rpath/dot/setenv"
  4. fi
  5. setenv(){
  6. if test -d "$ENVDIR" ; then
  7. # The way to make system more flexible.
  8. # Actually I'm really tired of editing one big file.
  9. # It is really easier to change specific one with variables
  10. # or modules.
  11. # Set variables from files.
  12. sh="$1"
  13. for i in "$ENVDIR/$sh/var"/* ; do
  14. if test -r "$i" ; then
  15. export "`basename \"$i\"`"="`cat \"$i\"`"
  16. fi
  17. done
  18. # Modules.
  19. for i in "$ENVDIR/$sh/rc"/*; do
  20. if test -r "$i" ; then
  21. . "$i"
  22. fi
  23. done
  24. fi
  25. }