]> git.pld-linux.org Git - projects/setup.git/blame - etc/profile
- add /usr/X11R6/bin and $HOME/bin to PATH if missing
[projects/setup.git] / etc / profile
CommitLineData
9bfefe38 1# /etc/profile
2
3# System wide environment and startup programs
99306191 4# Functions and aliases go into the shells dependent startup files
9bfefe38 5
505106d0
JR
6[ "`echo $PATH | grep -q /usr/X11R6/bin`" = "" ] && PATH="$PATH:/usr/X11R6/bin"
7[ "`echo $PATH | grep -q "$HOME/bin"`" = "" ] && PATH="$PATH:$HOME/bin"
9bfefe38 8
9bfefe38 9if [ `id -gn` = `id -un` -a `id -u` -gt 14 ]; then
b62ea61b 10 umask 002
9bfefe38 11else
b62ea61b 12 umask 022
9bfefe38 13fi
14
15USER=`id -un`
16LOGNAME=$USER
b62ea61b 17MAIL="/var/mail/$USER"
9bfefe38 18
19HOSTNAME=`/bin/hostname`
9783a53d 20HISTFILE="$HOME/.history"
9bfefe38 21HISTSIZE=1000
22HISTFILESIZE=1000
99306191 23
24#
25# Setup the environment for varius shells
26#
27
b62ea61b
JR
28if [ "$TERM" = "" -o "$TERM" = "unknown" ]; then
29 TERM=linux
30fi
31
9783a53d 32SH="${0#\-}"
558c4ec4 33if [ "$SH" = "sh" ]; then
516614fd 34 if [ -n "$KSH_VERSION" ]; then
9783a53d 35 SH=ksh
516614fd 36 elif [ -n "$BASH_VERSION" ]; then
9783a53d
JR
37 SH=bash
38 fi
39fi
40
41case "$SH" in
99306191 42 bash)
516614fd 43 PS1="[\u@\h \W]\\$ "
99306191 44 ;;
45 ksh|pdksh)
8a243315
JR
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
99306191 61 PS2='> '
62 set -o emacs
47f173c9
JR
63 bind '^I'=complete >/dev/null 2>&1
64 bind '^[^I'=complete-list >/dev/null 2>&1
99306191 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)
47f173c9
JR
71 bind '^[[H'=beginning-of-line >/dev/null 2>&1
72 bind '^[[F'=end-of-line >/dev/null 2>&1
99306191 73 ;;
74 linux)
47f173c9
JR
75 bind '^[1~'=beginning-of-line >/dev/null 2>&1
76 bind '^[4~'=end-of-line >/dev/null 2>&1
99306191 77 ;;
78 esac
79 ;;
80 zsh)
516614fd 81 PS1="[%m:%~%]# "
99306191 82 ;;
83esac
84
9783a53d
JR
85unset SH
86export PATH PS1 PS2 HOSTNAME HISTFILE HISTSIZE HISTFILESIZE USER LOGNAME MAIL
9bfefe38 87
88for i in /etc/profile.d/*.sh ; do
89 if [ -x $i ]; then
90 . $i
91 fi
92done
93
94unset i
This page took 0.039812 seconds and 4 git commands to generate.