KSH 登录错误

KSH 登录错误

我的云团队在 AWS 中为我​​设置了一个 Ubuntu 16.04 AMI。他们做了一些事情来“强化”实例,但他们通常使用 amazon linux 而不是 Ubuntu,所以我认为他们破坏了一些东西。看起来他们强制使用 KSH shell,这很好,但当我登录时我得到:

上次登录:2017 年 4 月 13 日星期四 13:56:48 来自 10.210.147.12

/etc/profile[23]: .[123]: local: not found [No such file or directory]
/etc/profile[23]: .[124]: local: not found [No such file or directory]
/etc/profile[23]: .[125]: local: not found [No such file or directory]
/etc/profile[23]: .[160]: local: not found [No such file or directory]
/etc/profile[23]: .[161]: local: not found [No such file or directory]

/etc/profile 中的第 23 行看起来像一个循环,用于在登录时执行一些 shell 脚本:

if [ -d /etc/profile.d ]; then
  for i in /etc/profile.d/*.sh; do
    if [ -r $i ]; then
      . $i
    fi
  done
  unset i
fi

我在 /etc/profile.d/* 中有以下脚本

bash_completion.sh
puppet-agent.sh
cedilla-portuguese.sh
Z97-byobu.sh
apps-bin-path.sh  
puppet-agent.csh
Z99-cloud-locale-test.sh

无论如何,我真的希望停止登录时出现烦人的错误消息。有人能帮忙吗?

谢谢,艾德

相关内容