分页: 1 / 1

关于/etc/profile的问题请教高手:)

发表于 : 2008-11-22 16:59
forpeace
配置tomcat5.5时,改动了profile文件,后来我又把自己添加的东西给删掉了,可是现在进不去ubuntu了,提示错误信息为:ubuntu /etc/profile:1:Syntax error:"(" unexpected
现在我的profile文件内容如下:
# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).

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

if [ "$PS1" ]; then
if [ "$BASH" ]; then
PS1='\u@\h:\w\$ '
if [ -f /etc/bash.bashrc ]; then
. /etc/bash.bashrc
fi
else
if [ "`id -u`" -eq 0 ]; then
PS1='# '
else
PS1='$ '
fi
fi
fi

umask 022

请高人指点一下怎么回出问题呢?

Re: 关于/etc/profile的问题请教高手:)

发表于 : 2008-11-22 18:43
BigSnake.NET
贴代码请使用

代码: 全选

。。。

Re: 关于/etc/profile的问题请教高手:)

发表于 : 2008-11-22 19:06
sevk
我的:

代码: 全选

# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).

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

if [ "$PS1" ]; then
  if [ "$BASH" ]; then
    PS1='\u@\h:\w\$ '
    if [ -f /etc/bash.bashrc ]; then
	. /etc/bash.bashrc
    fi
  else
    if [ "`id -u`" -eq 0 ]; then
      PS1='# '
    else
      PS1='$ '
    fi
  fi
fi

umask 022

Re: 关于/etc/profile的问题请教高手:)

发表于 : 2008-11-22 19:08
BigSnake.NET
我这里没问题 。。

Re: 关于/etc/profile的问题请教高手:)

发表于 : 2008-11-22 19:43
xhy
/etc/profile.d/*.sh //这个目录下的文件可能有问题

Re: 关于/etc/profile的问题请教高手:)

发表于 : 2008-11-22 19:45
BigSnake.NET
xhy 写了:/etc/profile.d/*.sh //这个目录下的文件可能有问题
从提示看是第一行出问题。。

诡异。。

Re: 关于/etc/profile的问题请教高手:)

发表于 : 2008-11-22 19:58
forpeace
第一行出问题?不是被注释掉了吗?
不过,我把第一、二行删掉后又出现了新错
/etc/profile: 1:
:not found
/etc/profile: 2:
:not found
/etc/profile:4: Syntax error: word unexpected(expecting "do")

真是奇怪了,被注释掉了的两行又用吗?