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-2011 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
23 if [ -x /usr/libexec/path_helper ]; then
24 eval `/usr/libexec/path_helper -s`
26 PATH="/usr/local/bin:/usr/bin:/bin"
27 [ "$UID" -eq 0 ] && PATH="/usr/local/sbin:/usr/sbin:/sbin:$PATH"
30 # prepend optional directories to PATH ...
32 for d in /Developer/usr/bin /usr/pkg/bin /opt/*/bin; do
33 [ -d "$d" -o -h "$d" ] && path="$path$d:"
35 [ -n "$path" ] && PATH="$path$PATH"
36 if [ "$UID" -eq 0 ]; then
38 for d in /usr/pkg/sbin /opt/*/sbin; do
39 [ -d "$d" -o -h "$d" ] && path="$path$d:"
41 [ -n "$path" ] && PATH="$path$PATH"
43 # append optional directories to PATH ...
44 for d in /usr/bin/X11 /usr/games; do
45 [ -d "$d" -o -h "$d" ] && PATH="$PATH:$d"
47 # set PATH so it includes user's private executables
48 [ -d ~/Applications ] && PATH=~/Applications:"${PATH}"
49 [ -d ~/bin ] && PATH=~/bin:"${PATH}"
50 [ -d ~/sbin ] && PATH=~/sbin:"${PATH}"
52 # Setup MANPATH, if manpath(1) isn't available
53 if [ ! "$(type manpath 2>/dev/null)" ]; then
55 && MANPATH="/usr/local/share/man:/usr/share/man:/usr/man"
57 for d in /usr/pkg/share/man /usr/pkg/man /opt/*/share/man /opt/*/man; do
58 [ -d "$d" -o -h "$d" ] && path="$path$d:"
60 [ -n "$path" ] && MANPATH="$path$MANPATH"
61 [ -d ~/share/man ] && MANPATH=~/share/man:"${MANPATH}"
62 [ -d ~/man ] && MANPATH=~/man:"${MANPATH}"
65 # set variable identifying the chroot you work in
66 [ -r /etc/debian_chroot ] && chroot_name=$(cat /etc/debian_chroot)
67 [ -r /etc/chroot_name ] && chroot_name=$(cat /etc/chroot_name)
69 # validate terminal definition
70 [ -z "$TERM" ] && eval `tset -s -Q`
72 # make sure $UID and $USER is set
73 [ -z "$UID" ] && UID=`id -u`
74 [ -z "$USER" ] && USER=`id -un`
78 ME=`hostname 2>/dev/null`
81 # Move Xauthority file to local storage, so that sudo et all work
82 if [ -z "$XAUTHORITY" -a -r ~/.Xauthority ]; then
83 cp ~/.Xauthority /tmp/Xauthority-$USER
84 chmod 600 /tmp/Xauthority-$USER
85 export XAUTHORITY="/tmp/Xauthority-$USER"
88 # read profile additions
89 if [ -d /etc/profile.d ]; then
90 for f in /etc/profile.d/*; do
91 [ -r "$f" ] || continue
96 [ -e ~/.ConfigScripts.debug ] \
103 # read local profile, if available
104 [ -r "/var/lib/${ME}/profile" ] && . /var/lib/${ME}/profile
106 # Setup some directories to use local storage (no NFS)
107 [ -d "/usr/local/home/$USER" ] \
108 || mkdir -p "/usr/local/home/$USER" >/dev/null 2>&1
109 if [ -w "/usr/local/home/$USER" ]; then
110 export LOCAL_HOME="/usr/local/home/$USER"
111 export CCACHE_DIR="$LOCAL_HOME/.ccache"
112 export XDG_CACHE_HOME="$LOCAL_HOME/.cache"
118 # generic shell prompt
124 type -p icalBuddy >/dev/null 2>&1
125 if [ $? -eq 0 -a "$UID" -ne 0 ]; then
127 *.UTF*) BUL="•"; SEP="»"; ;;
128 *) BUL="*"; SEP=">"; ;;
130 icalBuddy -f -n -npn -nc -b " $BUL " -ps "/ $SEP /" -eep "url,notes" \
131 eventsToday+1 | grep "$BUL"
135 type -p remind >/dev/null 2>&1
136 if [ $? -eq 0 -a -r ~/.remind ]; then
137 remind -h -g -t5 .remind | grep "^[0-9]"
142 # bash-specific initialization
143 [ "$BASH" -a -z "$BASHRCREAD" -a -r /etc/bash.bashrc ] \
144 && source /etc/bash.bashrc
145 [ "$BASH" -a -z "$BASHRCREAD" -a -r /etc/bashrc ] \
146 && source /etc/bashrc
148 # ksh-specific initialization
149 [ "$KSH_VERSION" -a -z "$KSHRCREAD" -a -r /etc/ksh.kshrc ] \
152 # Check filesystem quotas
153 mount 2>/dev/null | grep quota >/dev/null 2>&1
154 if [ $? -eq 0 ]; then
155 which quota >/dev/null 2>&1
156 [ $? -eq 0 ] && quota -q