summaryrefslogtreecommitdiff
path: root/profile
diff options
context:
space:
mode:
Diffstat (limited to 'profile')
-rw-r--r--profile58
1 files changed, 4 insertions, 54 deletions
diff --git a/profile b/profile
index eddf6bd..d81777b 100644
--- a/profile
+++ b/profile
@@ -1,65 +1,15 @@
# /etc/profile
-# System wide environment and startup programs, for login setup
+# System wide environment and startup programs
# Functions and aliases go in /etc/bashrc
-# It's NOT good idea to change this file unless you know what you
-# are doing. Much better way is to create custom.sh shell script in
-# /etc/profile.d/ to make custom changes to environment. This will
-# prevent need for merging in future updates.
-
-pathmunge () {
- if ! echo $PATH | /bin/grep -qE "(^|:)$1($|:)" ; then
- if [ "$2" = "after" ] ; then
- PATH=$PATH:$1
- else
- PATH=$1:$PATH
- fi
- fi
-}
-
-
-if [ -x /usr/bin/id ]; then
- if [ -z "$EUID" ]; then
- # ksh workaround
- EUID=`id -u`
- UID=`id -ru`
- fi
- USER="`id -un`"
- LOGNAME=$USER
- MAIL="/var/spool/mail/$USER"
-fi
-
-# Path manipulation
-if [ "$EUID" = "0" ]; then
- pathmunge /sbin
- pathmunge /usr/sbin
- pathmunge /usr/local/sbin
-else
- pathmunge /usr/local/sbin after
- pathmunge /usr/sbin after
- pathmunge /sbin after
-fi
-
-HOSTNAME=`/bin/hostname 2>/dev/null`
+HOSTNAME=`/bin/hostname`
HISTSIZE=1000
-if [ "$HISTCONTROL" = "ignorespace" ] ; then
- export HISTCONTROL=ignoreboth
-else
- export HISTCONTROL=ignoredups
-fi
-export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROL
+export PATH HOSTNAME HISTSIZE
for i in /etc/profile.d/*.sh ; do
if [ -r "$i" ]; then
- if [ "$PS1" ]; then
- . $i
- else
- . $i >/dev/null 2>&1
- fi
+ . $i
fi
done
-
-unset i
-unset pathmunge