4 # System wide environment and startup programs
5 # Functions and aliases go into the shells dependent startup files
7 # returns TRUE if $1 contains $2
9 [[ $1 = *$2* ]] && return 0 || return 1
11 strstr "$PATH" /usr/X11R6/bin || PATH="$PATH:/usr/X11R6/bin"
12 strstr "$PATH" /usr/local/bin || PATH="$PATH:/usr/local/bin"
13 strstr "$PATH" "$HOME/bin" || PATH="$PATH:$HOME/bin"
19 HOSTNAME=`/bin/uname -n`
20 HISTFILE="$HOME/.history"
23 if [ `id -gn` = $USER -a `id -u` -gt 14 ]; then
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
58 bind '^I'=complete >/dev/null 2>&1
59 bind '^[^I'=complete-list >/dev/null 2>&1
61 # Setup some of the most basic editing functions
62 # to work properly under different terminal emulators.
65 nxterm|xterm|xterm-color)
66 bind '^[[H'=beginning-of-line >/dev/null 2>&1
67 bind '^[[F'=end-of-line >/dev/null 2>&1
70 bind '^[[1~'=beginning-of-line >/dev/null 2>&1
71 bind '^[[4~'=end-of-line >/dev/null 2>&1
76 if [ `id -u` -eq 0 ]; then
77 PS1='[${LOGNAME-$USER}@${HOSTNAME} `
78 if [ "$PWD" = "/${PWD##*/}" ]; then
84 PS1='[${LOGNAME-$USER}@${HOSTNAME} `
85 if [ "$PWD" = "/${PWD##*/}" ]; then
95 nxterm|xterm|xterm-color)
96 trap 'case ${.sh.edchar} in "
\e[F") .sh.edchar="
\ 5" ;; "
\e[H") .sh.edchar="
\ 1" ;; esac' KEYBD
99 trap 'case ${.sh.edchar} in "
\e[4~") .sh.edchar="
\ 5" ;; "
\e[1~") .sh.edchar="
\ 1" ;; esac' KEYBD
104 # other HISTFILE, zsh uses diffrent fmt
106 # w/o this hist file won't get saved!
112 export PATH USER LOGNAME HOSTNAME HISTFILE HISTSIZE PS1 PS2
114 # Put all of the variables as files in /etc/env.d/
116 # cat /etc/env.d/VARIABLE
118 if [ -f /etc/profile.env ]; then
121 for i in /etc/env.d/* ; do
124 *~ | *.bak | *.old | *.rpmnew | *.rpmsave )
138 for i in /etc/profile.d/*.sh ; do