]> git.pld-linux.org Git - projects/setup.git/blame - etc/profile
- Removed setting of MAIL variable. It is done by pam_mail module.
[projects/setup.git] / etc / profile
CommitLineData
9bfefe38 1# /etc/profile
06efe2f9 2# $Id$
9bfefe38 3
4# System wide environment and startup programs
99306191 5# Functions and aliases go into the shells dependent startup files
9bfefe38 6
505106d0
JR
7[ "`echo $PATH | grep -q /usr/X11R6/bin`" = "" ] && PATH="$PATH:/usr/X11R6/bin"
8[ "`echo $PATH | grep -q "$HOME/bin"`" = "" ] && PATH="$PATH:$HOME/bin"
9bfefe38 9
9bfefe38 10if [ `id -gn` = `id -un` -a `id -u` -gt 14 ]; then
b62ea61b 11 umask 002
9bfefe38 12else
b62ea61b 13 umask 022
9bfefe38 14fi
15
16USER=`id -un`
17LOGNAME=$USER
9bfefe38 18
19HOSTNAME=`/bin/hostname`
9783a53d 20HISTFILE="$HOME/.history"
9bfefe38 21HISTSIZE=1000
22HISTFILESIZE=1000
99306191 23
24#
33f77e8b 25# Setup the environment for various shells
99306191 26#
27
b62ea61b
JR
28if [ "$TERM" = "" -o "$TERM" = "unknown" ]; then
29 TERM=linux
30fi
31
9783a53d 32SH="${0#\-}"
65b2ff24 33SH="${SH#/bin/}"
558c4ec4 34if [ "$SH" = "sh" ]; then
516614fd 35 if [ -n "$KSH_VERSION" ]; then
9783a53d 36 SH=ksh
de30a7eb
AM
37 elif [ -n "$ZSH_VERSION" ]; then
38 SH=zsh
516614fd 39 elif [ -n "$BASH_VERSION" ]; then
9783a53d 40 SH=bash
8545780a
JR
41 elif [ -n "`$SH -c 'echo ${.sh.version}' 2>/dev/null`" ]; then
42 SH=ksh93
9783a53d
JR
43 fi
44fi
45
46case "$SH" in
99306191 47 bash)
516614fd 48 PS1="[\u@\h \W]\\$ "
99306191 49 ;;
50 ksh|pdksh)
8a243315
JR
51 if [ `id -u` -eq 0 ]; then
52 PS1='[${LOGNAME-$USER}@${HOSTNAME} `
53 if [ "$PWD" = "/${PWD##*/}" ]; then
54 echo $PWD;
55 else
56 echo ${PWD##*/};
57 fi`]# '
58 else
59 PS1='[${LOGNAME-$USER}@${HOSTNAME} `
60 if [ "$PWD" = "/${PWD##*/}" ]; then
61 echo $PWD;
62 else
63 echo ${PWD##*/};
64 fi`]$ '
65 fi
99306191 66 PS2='> '
67 set -o emacs
47f173c9
JR
68 bind '^I'=complete >/dev/null 2>&1
69 bind '^[^I'=complete-list >/dev/null 2>&1
99306191 70 #
71 # Setup some of the most basic editing functions
72 # to work properly under different termnal emulators.
73 #
74 case $TERM in
75 nxterm|xterm|xterm-color|rxvt)
47f173c9
JR
76 bind '^[[H'=beginning-of-line >/dev/null 2>&1
77 bind '^[[F'=end-of-line >/dev/null 2>&1
99306191 78 ;;
79 linux)
47f173c9
JR
80 bind '^[1~'=beginning-of-line >/dev/null 2>&1
81 bind '^[4~'=end-of-line >/dev/null 2>&1
99306191 82 ;;
83 esac
84 ;;
cc2c9e93
AM
85 ksh93)
86 if [ `id -u` -eq 0 ]; then
87 PS1='[${LOGNAME-$USER}@${HOSTNAME} `
88 if [ "$PWD" = "/${PWD##*/}" ]; then
89 echo $PWD;
90 else
91 echo ${PWD##*/};
92 fi`]# '
93 else
94 PS1='[${LOGNAME-$USER}@${HOSTNAME} `
95 if [ "$PWD" = "/${PWD##*/}" ]; then
96 echo $PWD;
97 else
98 echo ${PWD##*/};
99 fi`]$ '
100 fi
101 PS2='> '
b429d9d3 102 set -o nolog
cc2c9e93 103 set -o emacs
ed7da3d6
JR
104 case $TERM in
105 nxterm|xterm|xterm-color|rxvt)
106 trap 'case ${.sh.edchar} in "\e[F") .sh.edchar="\ 5" ;; "\e[H") .sh.edchar="\ 1" ;; esac' KEYBD
107 ;;
108 linux)
109 trap 'case ${.sh.edchar} in "\e[4~") .sh.edchar="\ 5" ;; "\e[1~") .sh.edchar="\ 1" ;; esac' KEYBD
110 ;;
111 esac
cc2c9e93 112 ;;
99306191 113 zsh)
de30a7eb 114 PS1='[%n@%m %~]%(!.#.%\$) '
06efe2f9
AM
115
116 # Setup key bindings
de30a7eb 117 bindkey -e >/dev/null 2>&1
06efe2f9
AM
118 bindkey "^[[1~" beginning-of-line >/dev/null 2>&1
119 bindkey "^[[H" beginning-of-line >/dev/null 2>&1
120 bindkey "^[[4~" end-of-line >/dev/null 2>&1
121 bindkey "^[[F" end-of-line >/dev/null 2>&1
122 bindkey "^[[3~" delete-char >/dev/null 2>&1
123 bindkey "^[[5~" history-search-backward >/dev/null 2>&1
124 bindkey "^[[6~" history-search-forward >/dev/null 2>&1
125
126 case "$TERM" in
127 aterm)
128 bindkey '^[[A' up-line-or-history >/dev/null 2>&1
129 bindkey '^[[B' down-line-or-history >/dev/null 2>&1
130 bindkey '^[[D' backward-char >/dev/null 2>&1
131 bindkey '^[[C' forward-char >/dev/null 2>&1
132 ;;
133 esac
134 # other HISTFILE, zsh uses diffrent fmt
135 HISTFILE=~/.historyz
136 # w/o this hist file wont get saved !
137 SAVEHIST=$HISTSIZE
99306191 138 ;;
139esac
140
9783a53d
JR
141unset SH
142export PATH PS1 PS2 HOSTNAME HISTFILE HISTSIZE HISTFILESIZE USER LOGNAME MAIL
9bfefe38 143
144for i in /etc/profile.d/*.sh ; do
145 if [ -x $i ]; then
146 . $i
147 fi
148done
149
150unset i
06efe2f9
AM
151
152# vi:syntax=sh
This page took 0.094928 seconds and 4 git commands to generate.