5 kx #
5 kx # /etc/profile: This file contains system-wide defaults used by
5 kx # all Bourne (and related) shells.
5 kx
5 kx #
5 kx # Set the values for some environment variables:
5 kx #
5 kx export MINICOM="-c on"
5 kx export HOSTNAME="`cat /etc/HOSTNAME`"
5 kx export LESSOPEN="|lesspipe.sh %s"
5 kx # Setting a default $LESS was something inherited from SLS many years ago,
5 kx # but apparently the previous setting of "-M" causes display issues with
5 kx # some programs (i.e. git log). Adding "-R" as well fixes this, but some
5 kx # folks have concerns about the security of this option (I think it's
5 kx # actually "-r" that's the dangerous one). Anyway, it might be best to
5 kx # just leave this unset by default. Uncomment it if you like, or set
5 kx # up your own definition or aliases on a per-account basis.
5 kx #export LESS="-M -R"
5 kx
5 kx #
5 kx # If the user doesn't have a .inputrc, use the one in /etc.
5 kx #
5 kx if [ ! -r "$HOME/.inputrc" ]; then
5 kx export INPUTRC=/etc/inputrc
5 kx fi
5 kx
5 kx #
5 kx # Set the default system $PATH:
5 kx #
5 kx PATH="/usr/local/bin:/usr/bin:/bin:/usr/games"
5 kx
5 kx #
5 kx # For root users, ensure that /usr/local/sbin, /usr/sbin, and /sbin are in
5 kx # the $PATH. Some means of connection don't add these by default (sshd comes
5 kx # to mind).
5 kx #
5 kx if [ "`id -u`" = "0" ]; then
5 kx echo $PATH | grep /usr/local/sbin 1> /dev/null 2> /dev/null
5 kx if [ ! $? = 0 ]; then
5 kx PATH=/sbin/pkgtools:/sbin/setup:/usr/local/sbin:/usr/sbin:/sbin:$PATH
5 kx fi
5 kx fi
5 kx
5 kx #
5 kx # Set TERM to linux for unknown type or unset variable:
5 kx #
5 kx if [ "$TERM" = "" -o "$TERM" = "unknown" ]; then
5 kx TERM=linux
5 kx fi
5 kx
5 kx # Set ksh93 visual editing mode:
5 kx if [ "$SHELL" = "/bin/ksh" ]; then
5 kx VISUAL=emacs
5 kx # VISUAL=gmacs
5 kx # VISUAL=vi
5 kx fi
5 kx
5 kx #
5 kx # Set a default shell prompt:
5 kx # PS1='`hostname`:`pwd`# '
5 kx #
5 kx if [ "$SHELL" = "/bin/pdksh" ]; then
5 kx PS1='! $ '
5 kx elif [ "$SHELL" = "/bin/ksh" ]; then
5 kx PS1='! ${PWD/#$HOME/~}$ '
5 kx elif [ "$SHELL" = "/bin/zsh" ]; then
5 kx PS1='%n@%m:%~%# '
5 kx elif [ "$SHELL" = "/bin/ash" ]; then
5 kx PS1='$ '
5 kx else
5 kx PS1='\u@\h:\w\$ '
5 kx fi
5 kx PS2='> '
5 kx export PATH DISPLAY LESS TERM PS1 PS2
5 kx
5 kx # Default umask. A umask of 022 prevents new files from being created group
5 kx # and world writable.
5 kx umask 022
5 kx
5 kx # Notify user of incoming mail. This can be overridden in the user's
5 kx # local startup file (~/.bash.login or whatever, depending on the shell)
5 kx if [ -x /usr/bin/biff ]; then
5 kx biff y 2> /dev/null
5 kx fi
5 kx
5 kx # Append any additional sh scripts found in /etc/profile.d/:
5 kx for profile_script in /etc/profile.d/*.sh ; do
5 kx if [ -x $profile_script ]; then
5 kx . $profile_script
5 kx fi
5 kx done
5 kx unset profile_script