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