Linux误删etc下的profile,Linux centos 7 的/etc/profile 被我改坏了 忘记原来是什么样的了,怎么恢复?…

Linux误删etc下的profile,Linux centos 7 的/etc/profile 被我改坏了 忘记原来是什么样的了,怎么恢复?…系统版本:LinuxlinuxCentOS73.10.0-862.6.3.el7.x86_64#1SMPTueJun2616:32:21UTC2018x86_64x86_64x86_64GNU/Linux这是第一次改这个文件,所以谁有默认的能发给我一份吗?下面是我当前/etc/profile的内容,我只是在最后加个环境变量(后来为了恢复删了)#/etc/profile…

系统版本:Linux linuxCentOS7 3.10.0-862.6.3.el7.x86_64 #1 SMP Tue Jun 26 16:32:21 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

这是第一次改这个文件,所以谁有默认的能发给我一份吗?

下面是我当前/etc/profile的内容,我只是在最后加个环境变量(后来为了恢复删了)

# /etc/profile

# System wide environment and startup programs, for login setup

# Functions and aliases go in /etc/bashrc

# It’s NOT a good idea to change this file unless you know what you

# are doing. It’s much better to create a custom.sh shell script in

# /etc/profile.d/ to make custom changes to your environment, as this

# will prevent the need for merging in future updates.

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=`/usr/bin/id -u`

UID=`/usr/bin/id -ru`

fi

USER=”`/usr/bin/id -un`”

LOGNAME=$USER

MAIL=”/var/spool/mail/$USER”

fi

# Path manipulation

if [ “$EUID” = “0” ]; then

pathmunge /usr/sbin

pathmunge /usr/local/sbin

else

pathmunge /usr/local/sbin after

pathmunge /usr/sbin after

fi

HOSTNAME=`/usr/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

# By default, we want umask to get set. This sets it for login shell

# Current threshold for system reserved uid/gids is 200

# You could check uidgid reservation validity in

# /usr/share/doc/setup-*/uidgid file

if [ $UID -gt 199 ] && [ “`/usr/bin/id -gn`” = “`/usr/bin/id -un`” ]; then

umask 002

else

umask 022

fi

for i in /etc/profile.d/*.sh /etc/profile.d/sh.local ; do

if [ -r “$i” ]; then

if [ “${-#*i}” != “$-” ]; then

. “$i”

else

. “$i” >/dev/null

fi

fi

done

unset i

unset -f pathmunge

在执行source /etc/profile 的时候 一直报错:

aa19ff12943a27ef6c47d875662ce67d.png

使用/bin/vim /etc/profile 删除了自己加的两行,重新加载也还是一样的错误。可能我误动了其他地方。大家能帮我恢复正常吗?

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
如需转载请保留出处:https://bianchenghao.cn/38399.html

(0)
编程小号编程小号

相关推荐

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注