000-bash-setup-generic.sh 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #!/bin/bash
  2. scriptname=$(basename ${BASH_SOURCE[0]})
  3. scriptdirname=$(dirname ${BASH_SOURCE[0]})
  4. debug "Setup bash config."
  5. # don't put duplicate lines or lines starting with space in the history.
  6. # See bash(1) for more options
  7. HISTCONTROL=ignoreboth
  8. # append to the history file, don't overwrite it
  9. shopt -s histappend
  10. # for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
  11. HISTSIZE=10000
  12. HISTFILESIZE=50000
  13. # check the window size after each command and, if necessary,
  14. # update the values of LINES and COLUMNS.
  15. shopt -s checkwinsize
  16. # If set, the pattern "**" used in a pathname expansion context will
  17. # match all files and zero or more directories and subdirectories.
  18. #shopt -s globstar
  19. BASH_ALIASES="~/.bash_aliases"
  20. if [ -f "$BASH_ALIASES" ]; then
  21. debug "Loading '$BASH_ALIASES'."
  22. . $BASH_ALIASES
  23. fi
  24. # enable programmable completion features (you don't need to enable
  25. # this, if it's already enabled in /etc/bash.bashrc and /etc/profile
  26. # sources /etc/bash.bashrc).
  27. if ! shopt -oq posix; then
  28. if [ -f /usr/share/bash-completion/bash_completion ]; then
  29. BASH_COMPLETION=/usr/share/bash-completion/bash_completion
  30. elif [ -f /etc/bash_completion ]; then
  31. BASH_COMPLETION=/etc/bash_completion
  32. fi
  33. if [ -n "$BASH_COMPLETION" ]; then
  34. debug "Loading bash completion '$BASH_COMPLETION'."
  35. . $BASH_COMPLETION
  36. fi
  37. fi