bashrc 921 B

12345678910111213141516171819202122232425262728293031
  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. for file in ${SHELLRC_HOME}/rc.d/*.sh; do
  18. source ${file}
  19. done
  20. fi
  21. # load all files from .shell/bashrc.d directory
  22. if [ -d ${SHELLRC_HOME}/bashrc.d ]; then
  23. for file in ${SHELLRC_HOME}/bashrc.d/*.bash; do
  24. source ${file}
  25. done
  26. fi