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 # Initialize PATH variable
14 if [ -x /usr/libexec/path_helper ]; then
16 eval `/usr/libexec/path_helper -s`
18 PATH="/usr/local/bin:/usr/bin:/bin"
19 [ "$UID" -eq 0 ] && PATH="/usr/local/sbin:/usr/sbin:/sbin:$PATH"
21 # prepend optional directories to PATH ...
23 for d in /usr/pkg/bin /opt/*/bin; do
24 [ -d "$d" -o -h "$d" ] && path="$path$d:"
26 [ -n "$path" ] && PATH="$path$PATH"
27 if [ "$UID" -eq 0 ]; then
29 for d in /usr/pkg/sbin /opt/*/sbin; do
30 [ -d "$d" -o -h "$d" ] && path="$path$d:"
32 [ -n "$path" ] && PATH="$path$PATH"
34 # append optional directories to PATH ...
35 for d in /usr/bin/X11 /usr/games; do
36 [ -d "$d" -o -h "$d" ] && PATH="$PATH:$d"
38 # set PATH so it includes user's private executables
39 [ -d ~/Applications ] && PATH=~/Applications:"${PATH}"
40 [ -d ~/bin ] && PATH=~/bin:"${PATH}"
41 [ -d ~/sbin ] && PATH=~/sbin:"${PATH}"
43 # set MANPATH so it includes user's private man files
44 if [ -n "$MANPATH" ]; then
46 for d in /usr/pkg/share/man /usr/pkg/man /opt/*/share/man /opt/*/man; do
47 [ -d "$d" -o -h "$d" ] && path="$path$d:"
49 [ -n "$path" ] && MANPATH="$path$MANPATH"
51 [ -d ~/man ] && MANPATH=~/man:"${MANPATH}"
52 [ -d ~/share/man ] && MANPATH=~/share/man:"${MANPATH}"
54 # set variable identifying the chroot you work in
55 [ -r /etc/debian_chroot ] && chroot_name=$(cat /etc/debian_chroot)
56 [ -r /etc/chroot_name ] && chroot_name=$(cat /etc/chroot_name)
58 # validate terminal definition
59 [ -z "$TERM" ] && eval `tset -s -Q`
61 # make sure $UID and $USER is set
62 [ -z "$UID" ] && UID=`id -u`
63 [ -z "$USER" ] && USER=`id -un`
70 # read profile additions
71 if [ -d /etc/profile.d ]; then
72 for f in /etc/profile.d/*; do
77 # read local profile, if available
78 [ -r "/var/lib/${ME}/profile" ] && . /var/lib/${ME}/profile
83 # generic shell prompt
88 # bash-specific initialization
89 [ "$BASH" -a -z "$BASHRCREAD" -a -r /etc/bash.bashrc ] \
90 && source /etc/bash.bashrc
91 [ "$BASH" -a -z "$BASHRCREAD" -a -r /etc/bashrc ] \
94 # ksh-specific initialization
95 [ "$KSH_VERSION" -a -z "$KSHRCREAD" -a -r /etc/ksh.kshrc ] \
98 # Check filesystem quotas
99 which quota >/dev/null 2>&1
100 [ $? -eq 0 ] && quota -q