[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

좋은 웹페이지 즐겨찾기