bashrc 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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
  29. # load all the aliases from .shell/aliases.d
  30. if [ -d ${SHELLRC_HOME}/aliases.d ]; then
  31. echo ">>> Loading aliases.d"
  32. for file in ${SHELLRC_HOME}/aliases.d/*.aliases; do
  33. source ${file}
  34. done
  35. fi