【Linux/Centos7】 etc/profile 文件原文内容

前几天在centos7 安装jdk的时候,不小心手抖把etc/profile文件内容搞残了,找了好久才找到原文内容。

pathmunge () {
     
case ":${PATH}:" in
*:"$1":*)
;;
*)
if [ "$2" = "after" ] ; then
PATH=$PATH:$1
else
PATH=$1:$PATH
fi
esac
}
if [ -x /usr/bin/id ]; then
if [ -z "$EUID" ]; then
# ksh workaround
EUID=`baiid -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`
HISTSIZE=1000
if [ "$HISTCONTROL" = "ignorespace" ] ; then
export HISTCONTROL=ignoreboth
else
export HISTCONTROL=ignoredups
fi
export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROL
for i in /etc/profile.d/*.sh ; do
if [ -r "$i" ]; then
if [ "$PS1" ]; then
. $i
else
. $i >/dev/null 2>&1
fi
fi
done
unset i
unset pathmunge

希望对你有帮助。

参考链接:https://zhidao.baidu.com/question/338412889.html?qbl=relate_question_0&word=source%20etc/profile%20%CE%B4%D4%A4%C6%DA%B7%FB%BA%C5%27%29%27%B8%BD%BD%FC%D3%D0%D3%EF%B7%A8%B4%ED%CE%F3

你可能感兴趣的:(随笔,linux,centos,服务器)