3 # System wide environment and startup programs
4 # Functions and aliases go into the shells dependent startup files
6 # returns TRUE if $1 contains $2 and $2 is a dir
8 test -d "$2" || return 0
9 [[ $1 = *$2* ]] && return 0 || return 1
11 checkpath "$PATH" /usr/X11R6/bin || PATH="$PATH:/usr/X11R6/bin"
12 checkpath "$PATH" /usr/local/bin || PATH="$PATH:/usr/local/bin"
13 checkpath "$PATH" "$HOME/.local/bin" || PATH="$PATH:$HOME/.local/bin"
14 checkpath "$PATH" "$HOME/bin" || PATH="$PATH:$HOME/bin"
20 HOSTNAME=`/bin/uname -n`
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*|konsole*)
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*|konsole*)
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 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
122 # skip not-regular files
123 test -f "$i" || continue
127 *~ | *.bak | *.old | *.rpmnew | *.rpmsave | *.zwc )
132 . "$i"; eval [ '"${'"$NAME"'+X}"' = 'X' ] && export $NAME
141 for i in /etc/profile.d/*.sh ; do