bashrc 977 B

123456789101112131415161718192021222324252627282930313233
  1. # ${HOME}/.bashrc
  2. #
  3. # this file is sourced by all *interactive* bash shells on startup,
  4. # including some apparently interactive shells such as scp and rcp
  5. # that can't tolerate any output. so make sure this doesn't display
  6. # anything or bad things will happen !
  7. # test for an interactive shell. there is no need to set anything
  8. # past this point for scp and rcp, and it's important to refrain from
  9. # outputting anything in those cases.
  10. SHELLRC_HOME="$(dirname $(readlink -f ${BASH_SOURCE[0]}))"
  11. if [[ $- != *i* ]] || [[ -z "$PS1" ]]; then
  12. # shell is non-interactive. be done now!
  13. return
  14. fi
  15. # load all files from .shell/rc.d directory
  16. if [ -d ${SHELLRC_HOME}/rc.d ]; then
  17. echo ">>> Loading rc.d"
  18. for file in ${SHELLRC_HOME}/rc.d/*.sh; do
  19. source ${file}
  20. done
  21. fi
  22. # load all files from .shell/bashrc.d directory
  23. if [ -d ${SHELLRC_HOME}/bashrc.d ]; then
  24. echo ">>> Loading bashrc.d"
  25. for file in ${SHELLRC_HOME}/bashrc.d/*.bash; do
  26. source ${file}
  27. done
  28. fi