4 # System wide environment and startup programs
5 # Functions and aliases go into the shells dependent startup files
7 echo "$PATH" | grep -q /usr/X11R6/bin || PATH="$PATH:/usr/X11R6/bin"
8 echo "$PATH" | grep -q /usr/local/bin || PATH="$PATH:/usr/local/bin"
9 echo "$PATH" | grep -q "$HOME/bin" || PATH="$PATH:$HOME/bin"
11 if [ `id -gn` = `id -un` -a `id -u` -gt 14 ]; then
20 HOSTNAME=`/bin/uname -n`
21 HISTFILE="$HOME/.history"
25 # home_etc user config-dirs
30 # Setup the environment for various shells
33 if [ "$TERM" = "" -o "$TERM" = "unknown" ]; then
39 if [ "$SH" = "sh" ]; then
40 if [ -n "$KSH_VERSION" ]; then
42 elif [ -n "$ZSH_VERSION" ]; then
44 elif [ -n "$BASH_VERSION" ]; then
46 elif [ -n "`$SH -c 'echo ${.sh.version}' 2>/dev/null`" ]; then
55 PS1="\[\033]0;\u@\h: \w\007\][\u@\h \W]\\$ "
63 if [ `id -u` -eq 0 ]; then
64 PS1='[${LOGNAME-$USER}@${HOSTNAME} `
65 if [ "$PWD" = "/${PWD##*/}" ]; then
71 PS1='[${LOGNAME-$USER}@${HOSTNAME} `
72 if [ "$PWD" = "/${PWD##*/}" ]; then
80 bind '^I'=complete >/dev/null 2>&1
81 bind '^[^I'=complete-list >/dev/null 2>&1
83 # Setup some of the most basic editing functions
84 # to work properly under different termnal emulators.
87 nxterm|xterm|xterm-color|rxvt)
88 bind '^[[H'=beginning-of-line >/dev/null 2>&1
89 bind '^[[F'=end-of-line >/dev/null 2>&1
92 bind '^[1~'=beginning-of-line >/dev/null 2>&1
93 bind '^[4~'=end-of-line >/dev/null 2>&1
98 if [ `id -u` -eq 0 ]; then
99 PS1='[${LOGNAME-$USER}@${HOSTNAME} `
100 if [ "$PWD" = "/${PWD##*/}" ]; then
106 PS1='[${LOGNAME-$USER}@${HOSTNAME} `
107 if [ "$PWD" = "/${PWD##*/}" ]; then
117 nxterm|xterm|xterm-color|rxvt)
118 trap 'case ${.sh.edchar} in "
\e[F") .sh.edchar="
\ 5" ;; "
\e[H") .sh.edchar="
\ 1" ;; esac' KEYBD
121 trap 'case ${.sh.edchar} in "
\e[4~") .sh.edchar="
\ 5" ;; "
\e[1~") .sh.edchar="
\ 1" ;; esac' KEYBD
126 PS1='[%n@%m %~]%(!.#.%\$) '
133 # Setup key bindings:
134 bindkey -e >/dev/null 2>&1
135 bindkey "^[[1~" beginning-of-line >/dev/null 2>&1
136 bindkey "^[[H" beginning-of-line >/dev/null 2>&1
137 bindkey "^[[4~" end-of-line >/dev/null 2>&1
138 bindkey "^[[F" end-of-line >/dev/null 2>&1
139 bindkey "^[[3~" delete-char >/dev/null 2>&1
140 bindkey "^[[5~" history-search-backward >/dev/null 2>&1
141 bindkey "^[[6~" history-search-forward >/dev/null 2>&1
144 bindkey \`tput khome\` beginning-of-line >/dev/null 2>&1
145 bindkey \`tput kend\` end-of-line >/dev/null 2>&1
146 bindkey \`tput kdch1\` delete-char >/dev/null 2>&1
147 bindkey \`tput kpp\` up-history >/dev/null 2>&1
148 bindkey \`tput knp\` end-of-history >/dev/null 2>&1
149 bindkey \`tput kcuu1\` history-beginning-search-backward >/dev/null 2>&1
150 bindkey \`tput kcud1\` history-beginning-search-forward >/dev/null 2>&1
154 bindkey '^[[A' up-line-or-history >/dev/null 2>&1
155 bindkey '^[[B' down-line-or-history >/dev/null 2>&1
156 bindkey '^[[D' backward-char >/dev/null 2>&1
157 bindkey '^[[C' forward-char >/dev/null 2>&1
160 precmd () { print -Pn "\e]0;%n@%m: %~\a"i; }
163 # other HISTFILE, zsh uses diffrent fmt
165 # w/o this hist file wont get saved !
171 export PATH PS1 PS2 HOSTNAME HISTFILE HISTSIZE HISTFILESIZE USER LOGNAME MAIL
173 for i in /etc/profile.d/*.sh ; do