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 # Set locale if it is not set or doesn't contain a dot;
13 # but all system messages should still be in "native" ("C") language.
14 [ "$LANG" = "${LANG#*.}" -a "$LANG" != "C" ] \
15 && export LANG="${LANG:-de_DE}.ISO8859-1"
16 export LC_MESSAGES="C"
18 # Initialize PATH variable
20 if [ -x /usr/libexec/path_helper ]; then
22 eval `/usr/libexec/path_helper -s`
24 PATH="/usr/local/bin:/usr/bin:/bin"
25 [ "$UID" -eq 0 ] && PATH="/usr/local/sbin:/usr/sbin:/sbin:$PATH"
27 # prepend optional directories to PATH ...
29 for d in /usr/pkg/bin /opt/*/bin; do
30 [ -d "$d" -o -h "$d" ] && path="$path$d:"
32 [ -n "$path" ] && PATH="$path$PATH"
33 if [ "$UID" -eq 0 ]; then
35 for d in /usr/pkg/sbin /opt/*/sbin; do
36 [ -d "$d" -o -h "$d" ] && path="$path$d:"
38 [ -n "$path" ] && PATH="$path$PATH"
40 # append optional directories to PATH ...
41 for d in /usr/bin/X11 /usr/games; do
42 [ -d "$d" -o -h "$d" ] && PATH="$PATH:$d"
44 # set PATH so it includes user's private executables
45 [ -d ~/Applications ] && PATH=~/Applications:"${PATH}"
46 [ -d ~/bin ] && PATH=~/bin:"${PATH}"
47 [ -d ~/sbin ] && PATH=~/sbin:"${PATH}"
49 # set MANPATH so it includes user's private man files
50 if [ -n "$MANPATH" ]; then
52 for d in /usr/pkg/share/man /usr/pkg/man /opt/*/share/man /opt/*/man; do
53 [ -d "$d" -o -h "$d" ] && path="$path$d:"
55 [ -n "$path" ] && MANPATH="$path$MANPATH"
57 [ -d ~/man ] && MANPATH=~/man:"${MANPATH}"
58 [ -d ~/share/man ] && MANPATH=~/share/man:"${MANPATH}"
60 # set variable identifying the chroot you work in
61 [ -r /etc/debian_chroot ] && chroot_name=$(cat /etc/debian_chroot)
62 [ -r /etc/chroot_name ] && chroot_name=$(cat /etc/chroot_name)
64 # validate terminal definition
65 [ -z "$TERM" ] && eval `tset -s -Q`
67 # make sure $UID and $USER is set
68 [ -z "$UID" ] && UID=`id -u`
69 [ -z "$USER" ] && USER=`id -un`
76 # Move Xauthority file to local storage, so that sudo et all work
77 if [ -z "$XAUTHORITY" -a -r ~/.Xauthority ]; then
78 cp ~/.Xauthority /tmp/Xauthority-$USER
79 chmod 600 /tmp/Xauthority-$USER
80 export XAUTHORITY="/tmp/Xauthority-$USER"
83 # read profile additions
84 if [ -d /etc/profile.d ]; then
85 for f in /etc/profile.d/*; do
86 [ -r "$f" ] || continue
91 [ -e ~/.ConfigScripts.debug ] \
98 # read local profile, if available
99 [ -r "/var/lib/${ME}/profile" ] && . /var/lib/${ME}/profile
104 # generic shell prompt
109 # bash-specific initialization
110 [ "$BASH" -a -z "$BASHRCREAD" -a -r /etc/bash.bashrc ] \
111 && source /etc/bash.bashrc
112 [ "$BASH" -a -z "$BASHRCREAD" -a -r /etc/bashrc ] \
113 && source /etc/bashrc
115 # ksh-specific initialization
116 [ "$KSH_VERSION" -a -z "$KSHRCREAD" -a -r /etc/ksh.kshrc ] \
119 # Check filesystem quotas
120 which quota >/dev/null 2>&1
121 [ $? -eq 0 ] && quota -q