2 # /etc/bash.bashrc: System-wide rc file for interactive bash(1) shells.
3 # Written 2003-2010 by Alexander Barton (alex@barton.de)
6 [ -e ~/.ConfigScripts.debug ] && echo " >> /etc/bash.bashrc ..."
10 [ -z "$PROFILEREAD" -a -r /etc/profile ] && source /etc/profile
14 [ -r "/var/lib/$ME/bash.bashrc" ] && source /var/lib/$ME/bash.bashrc
22 set mark-directories on
23 set mark-symlinked-directories on
24 HISTCONTROL=ignoredups
28 ssh -o "StrictHostKeyChecking no" "$@"
31 ssh -o "StrictHostKeyChecking no" -o "UserKnownHostsFile /dev/null" "$@"
36 && PS1="\h:\w \\\$ " \
37 || PS1="\u@\h:\w \\\$ "
38 if [ "\$(type -t __git_ps1)" ]; then
39 PS1="\$(__git_ps1 '(%s) ')$PS1"
41 PS1="${chroot_name:+[$chroot_name] }$PS1"
43 # Enable bash completion, if available
44 [ -z "$BASH_COMPLETION" -a -r /etc/bash_completion ] \
45 && source /etc/bash_completion
46 [ -z "$BASH_COMPLETION" -a -r /opt/homebrew/etc/bash_completion ] \
47 && source /opt/homebrew/etc/bash_completion
48 [ -z "$BASH_COMPLETION" -a -r /opt/local/etc/bash_completion ] \
49 && source /opt/local/etc/bash_completion
51 # If the command-not-found package is installed, use it
52 if [ -r /etc/bash_command_not_found ]; then
53 . /etc/bash_command_not_found
54 elif [ -x /usr/lib/command-not-found ]; then
55 function command_not_found_handle {
56 # Check because c-n-f could've been removed in the meantime
57 if [ -x /usr/lib/command-not-found ]; then
58 /usr/bin/python /usr/lib/command-not-found -- $1
66 # Common command aliases
67 alias ","="clear && logout"
72 alias "lasth"="last | head -n \`expr \\\$LINES - 2\`"
74 # Aliases for screen(1), if installed
75 type -p screen >/dev/null 2>&1
78 alias "sr"="screen -dr"
79 alias "sx"="screen -x"
82 # less(1) filter, if available
83 type -p lesspipe >/dev/null 2>&1 && eval `lesspipe`
85 # Initialize ccache(1), if installed
86 if [ -d "/usr/lib/ccache" ]; then
87 PATH="/usr/lib/ccache:$PATH"
88 # Set the cache directory to local storage, if available
89 [ -w "/usr/local/home/$USER" ] \
90 && export CCACHE_DIR="/usr/local/home/$USER/.ccache"
93 # Setup slrn(1) and cleanscore(1), if installed
94 type -p cleanscore >/dev/null 2>&1
95 [ $? -eq 0 ] && alias slrn="cleanscore -f ~/.slrnscore && slrn"
97 # Enable color support of ls(1) and also add handy aliases
98 if [ "$TERM" != "dumb" ]; then
99 type -p dircolors >/dev/null 2>&1 && eval `dircolors -b`
100 ls --color / >/dev/null 2>&1
101 if [ $? -eq 0 ]; then
103 alias ls="ls --color=auto -F"
105 ls -G / >/dev/null 2>&1
106 if [ $? -eq 0 ]; then
113 # If this is an xterm set the title to user@host:dir
116 PROMPT_COMMAND='printf "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
122 # Source local files, if readable
123 [ -r "/etc/bashrc.local" ] && source /etc/bashrc.local
124 [ -r "/etc/bash.bashrc.local" ] && source /etc/bash.bashrc.local
125 [ -r "/var/lib/$ME/bash.bashrc" ] && source /var/lib/$ME/bash.bashrc