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/hostname`
21 HISTFILE="$HOME/.history"
26 # Setup the environment for various shells
29 if [ "$TERM" = "" -o "$TERM" = "unknown" ]; then
35 if [ "$SH" = "sh" ]; then
36 if [ -n "$KSH_VERSION" ]; then
38 elif [ -n "$ZSH_VERSION" ]; then
40 elif [ -n "$BASH_VERSION" ]; then
42 elif [ -n "`$SH -c 'echo ${.sh.version}' 2>/dev/null`" ]; then
52 if [ `id -u` -eq 0 ]; then
53 PS1='[${LOGNAME-$USER}@${HOSTNAME} `
54 if [ "$PWD" = "/${PWD##*/}" ]; then
60 PS1='[${LOGNAME-$USER}@${HOSTNAME} `
61 if [ "$PWD" = "/${PWD##*/}" ]; then
69 bind '^I'=complete >/dev/null 2>&1
70 bind '^[^I'=complete-list >/dev/null 2>&1
72 # Setup some of the most basic editing functions
73 # to work properly under different termnal emulators.
76 nxterm|xterm|xterm-color|rxvt)
77 bind '^[[H'=beginning-of-line >/dev/null 2>&1
78 bind '^[[F'=end-of-line >/dev/null 2>&1
81 bind '^[1~'=beginning-of-line >/dev/null 2>&1
82 bind '^[4~'=end-of-line >/dev/null 2>&1
87 if [ `id -u` -eq 0 ]; then
88 PS1='[${LOGNAME-$USER}@${HOSTNAME} `
89 if [ "$PWD" = "/${PWD##*/}" ]; then
95 PS1='[${LOGNAME-$USER}@${HOSTNAME} `
96 if [ "$PWD" = "/${PWD##*/}" ]; then
106 nxterm|xterm|xterm-color|rxvt)
107 trap 'case ${.sh.edchar} in "
\e[F") .sh.edchar="
\ 5" ;; "
\e[H") .sh.edchar="
\ 1" ;; esac' KEYBD
110 trap 'case ${.sh.edchar} in "
\e[4~") .sh.edchar="
\ 5" ;; "
\e[1~") .sh.edchar="
\ 1" ;; esac' KEYBD
115 PS1='[%n@%m %~]%(!.#.%\$) '
118 bindkey -e >/dev/null 2>&1
119 bindkey "^[[1~" beginning-of-line >/dev/null 2>&1
120 bindkey "^[[H" beginning-of-line >/dev/null 2>&1
121 bindkey "^[[4~" end-of-line >/dev/null 2>&1
122 bindkey "^[[F" end-of-line >/dev/null 2>&1
123 bindkey "^[[3~" delete-char >/dev/null 2>&1
124 bindkey "^[[5~" history-search-backward >/dev/null 2>&1
125 bindkey "^[[6~" history-search-forward >/dev/null 2>&1
129 bindkey '^[[A' up-line-or-history >/dev/null 2>&1
130 bindkey '^[[B' down-line-or-history >/dev/null 2>&1
131 bindkey '^[[D' backward-char >/dev/null 2>&1
132 bindkey '^[[C' forward-char >/dev/null 2>&1
135 # other HISTFILE, zsh uses diffrent fmt
137 # w/o this hist file wont get saved !
143 export PATH PS1 PS2 HOSTNAME HISTFILE HISTSIZE HISTFILESIZE USER LOGNAME MAIL
145 for i in /etc/profile.d/*.sh ; do