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 /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 # set MANPATH so it includes user's private man files
54 if [ -n "$MANPATH" ]; then
56 for d in /usr/pkg/share/man /usr/pkg/man /opt/*/share/man /opt/*/man; do
57 [ -d "$d" -o -h "$d" ] && path="$path$d:"
59 [ -n "$path" ] && MANPATH="$path$MANPATH"
61 [ -d ~/man ] && MANPATH=~/man:"${MANPATH}"
62 [ -d ~/share/man ] && MANPATH=~/share/man:"${MANPATH}"
64 # set variable identifying the chroot you work in
65 [ -r /etc/debian_chroot ] && chroot_name=$(cat /etc/debian_chroot)
66 [ -r /etc/chroot_name ] && chroot_name=$(cat /etc/chroot_name)
68 # validate terminal definition
69 [ -z "$TERM" ] && eval `tset -s -Q`
71 # make sure $UID and $USER is set
72 [ -z "$UID" ] && UID=`id -u`
73 [ -z "$USER" ] && USER=`id -un`
80 # Move Xauthority file to local storage, so that sudo et all work
81 if [ -z "$XAUTHORITY" -a -r ~/.Xauthority ]; then
82 cp ~/.Xauthority /tmp/Xauthority-$USER
83 chmod 600 /tmp/Xauthority-$USER
84 export XAUTHORITY="/tmp/Xauthority-$USER"
87 # read profile additions
88 if [ -d /etc/profile.d ]; then
89 for f in /etc/profile.d/*; do
90 [ -r "$f" ] || continue
95 [ -e ~/.ConfigScripts.debug ] \
102 # read local profile, if available
103 [ -r "/var/lib/${ME}/profile" ] && . /var/lib/${ME}/profile
108 # generic shell prompt
113 # bash-specific initialization
114 [ "$BASH" -a -z "$BASHRCREAD" -a -r /etc/bash.bashrc ] \
115 && source /etc/bash.bashrc
116 [ "$BASH" -a -z "$BASHRCREAD" -a -r /etc/bashrc ] \
117 && source /etc/bashrc
119 # ksh-specific initialization
120 [ "$KSH_VERSION" -a -z "$KSHRCREAD" -a -r /etc/ksh.kshrc ] \
123 # Check filesystem quotas
124 which quota >/dev/null 2>&1
125 [ $? -eq 0 ] && quota -q