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 and $2 is a dir
9 test -d "$2" || return 0
10 [[ $1 = *$2* ]] && return 0 || return 1
12 checkpath "$PATH" /usr/X11R6/bin || PATH="$PATH:/usr/X11R6/bin"
13 checkpath "$PATH" /usr/local/bin || PATH="$PATH:/usr/local/bin"
14 checkpath "$PATH" "$HOME/.local/bin" || PATH="$PATH:$HOME/.local/bin"
15 checkpath "$PATH" "$HOME/bin" || PATH="$PATH:$HOME/bin"
21 HOSTNAME=`/bin/uname -n`
22 HISTFILE="$HOME/.history"
25 if [ "`id -gn`" = $USER -a `id -u` -gt 14 ]; then
32 # Setup the environment for various shells
35 if [ "$TERM" = "" -o "$TERM" = "unknown" ]; then
41 if [ "$SH" = "sh" ]; then
42 if [ -n "$KSH_VERSION" ]; then
44 elif [ -n "$ZSH_VERSION" ]; then
46 elif [ -n "$BASH_VERSION" ]; then
48 elif [ -n "`$SH -c 'echo ${.sh.version}' 2>/dev/null`" ]; then
60 bind '^I'=complete >/dev/null 2>&1
61 bind '^[^I'=complete-list >/dev/null 2>&1
63 # Setup some of the most basic editing functions
64 # to work properly under different terminal emulators.
67 nxterm|xterm*|konsole*)
68 bind '^[[H'=beginning-of-line >/dev/null 2>&1
69 bind '^[[F'=end-of-line >/dev/null 2>&1
72 bind '^[[1~'=beginning-of-line >/dev/null 2>&1
73 bind '^[[4~'=end-of-line >/dev/null 2>&1
78 if [ `id -u` -eq 0 ]; then
79 PS1='[${LOGNAME-$USER}@${HOSTNAME} `
80 if [ "$PWD" = "/${PWD##*/}" ]; then
86 PS1='[${LOGNAME-$USER}@${HOSTNAME} `
87 if [ "$PWD" = "/${PWD##*/}" ]; then
97 nxterm|xterm*|konsole*)
98 trap 'case ${.sh.edchar} in "
\e[F") .sh.edchar="
\ 5" ;; "
\e[H") .sh.edchar="
\ 1" ;; esac' KEYBD
101 trap 'case ${.sh.edchar} in "
\e[4~") .sh.edchar="
\ 5" ;; "
\e[1~") .sh.edchar="
\ 1" ;; esac' KEYBD
106 # other HISTFILE, zsh uses diffrent fmt
108 # w/o this hist file won't get saved!
114 export PATH USER LOGNAME HOSTNAME HISTFILE HISTSIZE PS1 PS2
116 # Put all of the variables as files in /etc/env.d/
118 # cat /etc/env.d/VARIABLE
120 if [ -f /etc/profile.env ]; then
123 for i in /etc/env.d/* ; do
126 *~ | *.bak | *.old | *.rpmnew | *.rpmsave | *.zwc )
131 . "$i"; eval [ '"${'"$NAME"'+X}"' = 'X' ] && export $NAME
140 for i in /etc/profile.d/*.sh ; do