]> git.pld-linux.org Git - projects/setup.git/blob - etc/profile
- anyone can use sh
[projects/setup.git] / etc / profile
1 # /etc/profile
2
3 # System wide environment and startup programs
4 # Functions and aliases go into the shells dependent startup files
5
6 PATH="$PATH:/usr/X11R6/bin"
7
8 if [ `id -gn` = `id -un` -a `id -u` -gt 14 ]; then
9         umask 002
10 else
11         umask 022
12 fi
13
14 USER=`id -un`
15 LOGNAME=$USER
16 MAIL="/var/mail/$USER"
17
18 HOSTNAME=`/bin/hostname`
19 HISTFILE="$HOME/.history"
20 HISTSIZE=1000
21 HISTFILESIZE=1000
22
23 #
24 # Setup the environment for varius shells
25 #
26
27 if [ "$TERM" = "" -o "$TERM" = "unknown" ]; then
28  TERM=linux
29 fi
30
31 SH="${0#\-}"
32 if [ "$SH" = "sh" ]; then
33         if [ ! -n KSH_VERSION ]; then
34                 SH=ksh
35         elif [ ! -n BASH_VERSION ]; then
36                 SH=bash
37         fi
38 fi
39
40 case "$SH" in
41   ash)
42         PS1="${HOSTNAME}\$ "
43         ;;
44   bash)
45         PS1="\u@\h \W\\$ "
46         ;;
47   ksh|pdksh)
48         PS1='[${LOGNAME-$USER}@${HOSTNAME}`
49                 if [ "$PWD" = "${PWD##$HOME}" ]; then
50                         echo $PWD;
51                 else
52                         echo '~'${PWD##$HOME};
53         fi`] '$PS1
54         PS2='> '
55         set -o emacs
56         bind '^I'=complete
57         #
58         # Setup some of the most basic editing functions
59         # to work properly under different termnal emulators.
60         #
61         case $TERM in
62         nxterm|xterm|xterm-color|rxvt)
63                 bind '^[[H'=beginning-of-line
64                 bind '^[[F'=end-of-line
65                 ;;
66         linux)
67                 bind '^[1~'=beginning-of-line
68                 bind '^[4~'=end-of-line
69                 ;;
70         esac
71         ;;
72   zsh)
73         PS1="%m:%~%# "
74         ;;
75 esac
76
77 unset SH
78 export PATH PS1 PS2 HOSTNAME HISTFILE HISTSIZE HISTFILESIZE USER LOGNAME MAIL
79
80 for i in /etc/profile.d/*.sh ; do
81         if [ -x $i ]; then
82                 . $i
83         fi
84 done
85
86 unset i
This page took 0.061479 seconds and 4 git commands to generate.