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
27 #HOME_ETC=$HOME/$CONFIG_DIR
28 #export CONFIG_DIR HOME_ETC
31 # Setup the environment for various shells
34 if [ "$TERM" = "" -o "$TERM" = "unknown" ]; then
40 if [ "$SH" = "sh" ]; then
41 if [ -n "$KSH_VERSION" ]; then
43 elif [ -n "$ZSH_VERSION" ]; then
45 elif [ -n "$BASH_VERSION" ]; then
47 elif [ -n "`$SH -c 'echo ${.sh.version}' 2>/dev/null`" ]; then
56 PS1="\[\033]0;\u@\h: \w\007\][\u@\h \W]\\$ "
64 if [ `id -u` -eq 0 ]; then
65 PS1='[${LOGNAME-$USER}@${HOSTNAME} `
66 if [ "$PWD" = "/${PWD##*/}" ]; then
72 PS1='[${LOGNAME-$USER}@${HOSTNAME} `
73 if [ "$PWD" = "/${PWD##*/}" ]; then
81 bind '^[^I'=complete-list >/dev/null 2>&1
83 # Setup some of the most basic editing functions
84 # to work properly under different terminal emulators.
87 nxterm|xterm|xterm-color)
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)
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 %~]%(!.#.%\$) '
129 # other HISTFILE, zsh uses diffrent fmt
131 # w/o this hist file won't get saved!
137 export PATH USER LOGNAME HOSTNAME HISTFILE HISTSIZE HISTFILESIZE PS1 PS2
139 for i in /etc/profile.d/*.sh ; do