000-bash-setup-generic.sh 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. #!/bin/bash
  11. DEBUG=1
  12. [ -n "$DEBUG" ] && echo debug $0 >&2
  13. # for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
  14. HISTSIZE=10000
  15. HISTFILESIZE=50000
  16. # check the window size after each command and, if necessary,
  17. # update the values of LINES and COLUMNS.
  18. shopt -s checkwinsize
  19. # If set, the pattern "**" used in a pathname expansion context will
  20. # match all files and zero or more directories and subdirectories.
  21. #shopt -s globstar
  22. BASH_ALIASES="~/.bash_aliases"
  23. if [ -f "$BASH_ALIASES" ]; then
  24. debug "Loading '$BASH_ALIASES'."
  25. . $BASH_ALIASES
  26. fi
  27. # enable programmable completion features (you don't need to enable
  28. # this, if it's already enabled in /etc/bash.bashrc and /etc/profile
  29. # sources /etc/bash.bashrc).
  30. if ! shopt -oq posix; then
  31. if [ -f /usr/share/bash-completion/bash_completion ]; then
  32. BASH_COMPLETION=/usr/share/bash-completion/bash_completion
  33. elif [ -f /etc/bash_completion ]; then
  34. BASH_COMPLETION=/etc/bash_completion
  35. fi
  36. if [ -n "$BASH_COMPLETION" ]; then
  37. debug "Loading bash completion '$BASH_COMPLETION'."
  38. . $BASH_COMPLETION
  39. fi
  40. fi