summaryrefslogtreecommitdiff
path: root/tree/etc/profile
blob: 3be935e50209672702fc90423320cb1c1c70dc80 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
[ -x /usr/bin/vim ] && export EDITOR=${EDITOR:-/usr/bin/vim}
[ -x /usr/bin/less ] && export PAGER=${PAGER:-/usr/bin/less}


# Support for other shells
if [ -z $UID ]; then
  UID=$(id -u)
fi


if [ $UID -eq 0 ]; then
  PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
  PS1="$(uname -n 2>/dev/null) # "
else
  PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games"
  PS1="$(whoami 2>/dev/null)@$(uname -n 2>/dev/null) \$ "
fi
export PATH
export PS1


# Users don't want anyone else writing their files.  System applications allow
# their group-mates to write.
if [ $UID -gt 499 ]; then
  umask 022
else
  umask 002
fi


if [ "${BASH-}" ] && [ "$BASH" != "/bin/sh" ]; then
  [ -f /etc/bash/bashrc ] && . /etc/bash/bashrc
fi


if [ -d /etc/profile.d ]; then
  for i in /etc/profile.d/*.sh; do
    [ -r $i ] && . $i
  done
  unset i
fi