/etc/bash.bashrc


SUBMITTED BY: Guest

DATE: Jan. 13, 2013, 11:52 a.m.

FORMAT: Text only

SIZE: 3.7 kB

HITS: 1644

  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. cd
  5. bind '"\e[A"':history-search-backward
  6. bind '"\e[B"':history-search-forward
  7. export HISTCONTROL=$HISTCONTROL${HISTCONTROL+,}ignoredups
  8. export HISTCONTROL=ignoreboth
  9. export HISTCONTROL=ignorespaces
  10. export HISTIGNORE=??
  11. shopt -s histappend
  12. shopt -s checkwinsize
  13. PROMPT_COMMAND='history -a'
  14. export EDITOR=vim
  15. eval "$(lesspipe)"
  16. # If not running interactively, don't do anything
  17. [ -z "$PS1" ] && return
  18. # check the window size after each command and, if necessary,
  19. # update the values of LINES and COLUMNS.
  20. shopt -s checkwinsize
  21. # set variable identifying the chroot you work in (used in the prompt below)
  22. if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
  23. debian_chroot=$(cat /etc/debian_chroot)
  24. fi
  25. use_color=false
  26. # Set colorful PS1 only on colorful terminals.
  27. # dircolors --print-database uses its own built-in database
  28. # instead of using /etc/DIR_COLORS. Try to use the external file
  29. # first to take advantage of user additions. Use internal bash
  30. # globbing instead of external grep binary.
  31. safe_term=${TERM//[^[:alnum:]]/?} # sanitize TERM
  32. match_lhs=""
  33. [[ -f ~/.dir_colors ]] && match_lhs="${match_lhs}$(<~/.dir_colors)"
  34. [[ -f /etc/DIR_COLORS ]] && match_lhs="${match_lhs}$(</etc/DIR_COLORS)"
  35. [[ -z ${match_lhs} ]] \
  36. && type -P dircolors >/dev/null \
  37. && match_lhs=$(dircolors --print-database)
  38. [[ $'\n'${match_lhs} == *$'\n'"TERM "${safe_term}* ]] && use_color=true
  39. if ${use_color} ; then
  40. # Enable colors for ls, etc. Prefer ~/.dir_colors #64489
  41. if type -P dircolors >/dev/null ; then
  42. if [[ -f ~/.dir_colors ]] ; then
  43. eval $(dircolors -b ~/.dir_colors)
  44. elif [[ -f /etc/DIR_COLORS ]] ; then
  45. eval $(dircolors -b /etc/DIR_COLORS)
  46. fi
  47. fi
  48. if [[ ${EUID} == 0 ]] ; then
  49. PS1='${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\h\[\033[01;34m\] \W \$\[\033[00m\] '
  50. else
  51. PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\] '
  52. fi
  53. else
  54. if [[ ${EUID} == 0 ]] ; then
  55. # show root@ when we don't have colors
  56. PS1='\u@\h \W \$ '
  57. else
  58. PS1='\u@\h \w \$ '
  59. fi
  60. fi
  61. # Try to keep environment pollution down, EPA loves us.
  62. unset use_color safe_term match_lhs
  63. # Commented out, don't overwrite xterm -T "title" -n "icontitle" by default.
  64. # If this is an xterm set the title to user@host:dir
  65. #case "$TERM" in
  66. #xterm*|rxvt*)
  67. # PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
  68. # ;;
  69. #*)
  70. # ;;
  71. #esac
  72. # enable bash completion in interactive shells
  73. if [ -f /etc/bash_completion ]; then
  74. . /etc/bash_completion
  75. fi
  76. # if the command-not-found package is installed, use it
  77. if [ -x /usr/lib/command-not-found ]; then
  78. function command_not_found_handle {
  79. # check because c-n-f could've been removed in the meantime
  80. if [ -x /usr/lib/command-not-found ]; then
  81. /usr/bin/python /usr/lib/command-not-found -- $1
  82. return $?
  83. else
  84. return 127
  85. fi
  86. }
  87. fi
  88. . /etc/bash_aliases

comments powered by Disqus