bash.bashrc 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. # System-wide .bashrc file for interactive bash(1) shells.
  2. # To enable the settings / commands in this file for login shells as well,
  3. # this file has to be sourced in /etc/profile.
  4. # If not running interactively, don't do anything
  5. [ -z "$PS1" ] && return
  6. # check the window size after each command and, if necessary,
  7. # update the values of LINES and COLUMNS.
  8. shopt -s checkwinsize
  9. # set variable identifying the chroot you work in (used in the prompt below)
  10. if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
  11. debian_chroot=$(cat /etc/debian_chroot)
  12. fi
  13. # set a fancy prompt (non-color, overwrite the one in /etc/profile)
  14. # but only if not SUDOing and have SUDO_PS1 set; then assume smart user.
  15. if ! [ -n "${SUDO_USER}" -a -n "${SUDO_PS1}" ]; then
  16. PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
  17. fi
  18. # Commented out, don't overwrite xterm -T "title" -n "icontitle" by default.
  19. # If this is an xterm set the title to user@host:dir
  20. #case "$TERM" in
  21. #xterm*|rxvt*)
  22. # PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
  23. # ;;
  24. #*)
  25. # ;;
  26. #esac
  27. # enable bash completion in interactive shells
  28. #if ! shopt -oq posix; then
  29. # if [ -f /usr/share/bash-completion/bash_completion ]; then
  30. # . /usr/share/bash-completion/bash_completion
  31. # elif [ -f /etc/bash_completion ]; then
  32. # . /etc/bash_completion
  33. # fi
  34. #fi
  35. # if the command-not-found package is installed, use it
  36. if [ -x /usr/lib/command-not-found -o -x /usr/share/command-not-found/command-not-found ]; then
  37. function command_not_found_handle {
  38. # check because c-n-f could've been removed in the meantime
  39. if [ -x /usr/lib/command-not-found ]; then
  40. /usr/lib/command-not-found -- "$1"
  41. return $?
  42. elif [ -x /usr/share/command-not-found/command-not-found ]; then
  43. /usr/share/command-not-found/command-not-found -- "$1"
  44. return $?
  45. else
  46. printf "%s: command not found\n" "$1" >&2
  47. return 127
  48. fi
  49. }
  50. fi