2 # /etc/profile: system-wide profile for the Bourne shell (sh(1)) and
3 # Bourne compatible shells (bash(1), ksh(1), ash(1), ...).
4 # Written 2003-2009 by Alexander Barton (alex@barton.de)
7 [ -e ~/.ConfigScripts.debug ] && echo " >> /etc/profile ..."
12 # Make sure UID is set
13 [ -n "$UID" ] || UID=`id -u`
16 # Set locale if it is not set or doesn't contain a dot;
17 # but all system messages should still be in "native" ("C") language.
18 [ "$LANG" = "${LANG#*.}" -a "$LANG" != "C" ] \
19 && export LANG="${LANG:-de_DE}.ISO8859-1"
20 export LC_MESSAGES="C"
22 # Initialize PATH variable
24 if [ -x /usr/libexec/path_helper ]; then
26 eval `/usr/libexec/path_helper -s`
28 PATH="/usr/local/bin:/usr/bin:/bin"
29 [ "$UID" -eq 0 ] && PATH="/usr/local/sbin:/usr/sbin:/sbin:$PATH"
31 # prepend optional directories to PATH ...
33 for d in /Developer/usr/bin /usr/pkg/bin /opt/*/bin; do
34 [ -d "$d" -o -h "$d" ] && path="$path$d:"
36 [ -n "$path" ] && PATH="$path$PATH"
37 if [ "$UID" -eq 0 ]; then
39 for d in /usr/pkg/sbin /opt/*/sbin; do
40 [ -d "$d" -o -h "$d" ] && path="$path$d:"
42 [ -n "$path" ] && PATH="$path$PATH"
44 # append optional directories to PATH ...
45 for d in /usr/bin/X11 /usr/games; do
46 [ -d "$d" -o -h "$d" ] && PATH="$PATH:$d"
48 # set PATH so it includes user's private executables
49 [ -d ~/Applications ] && PATH=~/Applications:"${PATH}"
50 [ -d ~/bin ] && PATH=~/bin:"${PATH}"
51 [ -d ~/sbin ] && PATH=~/sbin:"${PATH}"
53 # Setup MANPATH, if manpath(1) isn't available
54 if [ ! "$(type manpath)" ]; then
56 && MANPATH="/usr/local/share/man:/usr/share/man:/usr/man"
58 for d in /usr/pkg/share/man /usr/pkg/man /opt/*/share/man /opt/*/man; do
59 [ -d "$d" -o -h "$d" ] && path="$path$d:"
61 [ -n "$path" ] && MANPATH="$path$MANPATH"
62 [ -d ~/share/man ] && MANPATH=~/share/man:"${MANPATH}"
63 [ -d ~/man ] && MANPATH=~/man:"${MANPATH}"
66 # set variable identifying the chroot you work in
67 [ -r /etc/debian_chroot ] && chroot_name=$(cat /etc/debian_chroot)
68 [ -r /etc/chroot_name ] && chroot_name=$(cat /etc/chroot_name)
70 # validate terminal definition
71 [ -z "$TERM" ] && eval `tset -s -Q`
73 # make sure $UID and $USER is set
74 [ -z "$UID" ] && UID=`id -u`
75 [ -z "$USER" ] && USER=`id -un`
82 # Move Xauthority file to local storage, so that sudo et all work
83 if [ -z "$XAUTHORITY" -a -r ~/.Xauthority ]; then
84 cp ~/.Xauthority /tmp/Xauthority-$USER
85 chmod 600 /tmp/Xauthority-$USER
86 export XAUTHORITY="/tmp/Xauthority-$USER"
89 # read profile additions
90 if [ -d /etc/profile.d ]; then
91 for f in /etc/profile.d/*; do
92 [ -r "$f" ] || continue
97 [ -e ~/.ConfigScripts.debug ] \
104 # read local profile, if available
105 [ -r "/var/lib/${ME}/profile" ] && . /var/lib/${ME}/profile
110 # generic shell prompt
115 # bash-specific initialization
116 [ "$BASH" -a -z "$BASHRCREAD" -a -r /etc/bash.bashrc ] \
117 && source /etc/bash.bashrc
118 [ "$BASH" -a -z "$BASHRCREAD" -a -r /etc/bashrc ] \
119 && source /etc/bashrc
121 # ksh-specific initialization
122 [ "$KSH_VERSION" -a -z "$KSHRCREAD" -a -r /etc/ksh.kshrc ] \
125 # Check filesystem quotas
126 which quota >/dev/null 2>&1
127 [ $? -eq 0 ] && quota -q