2 # /etc/bash.bashrc: System-wide rc file for interactive bash(1) shells.
4 # 2008-08-07, alex@barton.de
5 # - ls: Detech BSD color support (-G).
6 # - Support /etc/chroot_name
7 # 2008-07-09, alex@barton.de
8 # - Added support for /usr/lib/command-not-found.
9 # 2008-06-06, alex@barton.de
10 # - Source /etc/[bash].bashrc.local as well, if readable.
11 # 2007-04-05, alex@barton.de
12 # - Define shell functions sshtmp() and sshnew().
13 # 2006-01-04, alex@barton.de
14 # - Only call dircolors(1) and lesspipe(1) if they are available.
15 # - Check wether ls(1) knows something about "--color".
16 # 2005-12-29, alex@barton.de
17 # - Enabled bash completion
18 # 2004-09-13, alex@Arthur.Ath.CX
19 # - Made script more generic ...
20 # 2004-05-27, alex@Arthur.Ath.CX
23 #echo "/etc/bash.bashrc ..."
26 [ -z "$PROFILEREAD" -a -r /etc/profile ] && source /etc/profile
30 [ -r "/var/lib/$ME/bash.bashrc" ] && source /var/lib/$ME/bash.bashrc
38 set mark-directories on
39 set mark-symlinked-directories on
40 HISTCONTROL=ignoredups
44 ssh -o "StrictHostKeyChecking no" "$@"
47 ssh -o "StrictHostKeyChecking no" -o "UserKnownHostsFile /dev/null" "$@"
51 prefix="${chroot_name:+($chroot_name)}"
53 && PS1="${prefix}\h:\w \\\$ " \
54 || PS1="${prefix}\u@\h:\w \\\$ "
56 # Enable bash completion, if available
57 [ -r /etc/bash_completion ] && source /etc/bash_completion
59 # If the command-not-found package is installed, use it
60 if [ -x /usr/lib/command-not-found ]; then
61 function command_not_found_handle {
62 # Check because c-n-f could've been removed in the meantime
63 if [ -x /usr/lib/command-not-found ]; then
64 /usr/bin/python /usr/lib/command-not-found -- $1
72 # Common command aliases
73 alias ","="clear && logout"
78 alias "lasth"="last | head -n \`expr \\\$LINES - 2\`"
81 type -p lesspipe >/dev/null 2>&1 && eval `lesspipe`
83 # Enable color support of ls and also add handy aliases
84 if [ "$TERM" != "dumb" ]; then
85 type -p dircolors >/dev/null 2>&1 && eval `dircolors -b`
86 ls --color / >/dev/null 2>&1
89 alias ls="ls --color=auto -F"
91 ls -G / >/dev/null 2>&1
99 # If this is an xterm set the title to user@host:dir
102 PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
108 # Source local files, if readable
109 [ -r "/etc/bashrc.local" ] && source /etc/bashrc.local
110 [ -r "/etc/bash.bashrc.local" ] && source /etc/bash.bashrc.local
111 [ -r "/var/lib/$ME/bash.bashrc" ] && source /var/lib/$ME/bash.bashrc