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

系统安装、升级讨论
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
回复
forpeace
帖子: 10
注册时间: 2008-09-27 21:52

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

#1

帖子 forpeace » 2008-11-22 16:59

配置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

请高人指点一下怎么回出问题呢?
头像
BigSnake.NET
帖子: 12522
注册时间: 2006-07-02 11:16
来自: 廣州
联系:

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

#2

帖子 BigSnake.NET » 2008-11-22 18:43

贴代码请使用

代码: 全选

。。。
^_^ ~~~
要理解递归,首先要理解递归。

地球人都知道,理论上,理论跟实际是没有差别的,但实际上,理论跟实际的差别是相当大滴。
头像
sevk
帖子: 2060
注册时间: 2007-05-08 16:26
系统: arch
来自: 火星内核某分子内某原子核内
联系:

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

#3

帖子 sevk » 2008-11-22 19:06

我的:

代码: 全选

# /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
笔记本 :
F208S : gentoo
A460P i3G D6 : UBUNTU + WIN7
UN43D1 : UBUNTU + WIN7
1000人超级QQ群 LINUX + WIN : 31465544 或 18210387
头像
BigSnake.NET
帖子: 12522
注册时间: 2006-07-02 11:16
来自: 廣州
联系:

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

#4

帖子 BigSnake.NET » 2008-11-22 19:08

我这里没问题 。。
^_^ ~~~
要理解递归,首先要理解递归。

地球人都知道,理论上,理论跟实际是没有差别的,但实际上,理论跟实际的差别是相当大滴。
头像
xhy
帖子: 3916
注册时间: 2005-12-28 1:16
系统: Ubuntu 12.10 X64
来自: 火星

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

#5

帖子 xhy » 2008-11-22 19:43

/etc/profile.d/*.sh //这个目录下的文件可能有问题
目前负债150多万
头像
BigSnake.NET
帖子: 12522
注册时间: 2006-07-02 11:16
来自: 廣州
联系:

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

#6

帖子 BigSnake.NET » 2008-11-22 19:45

xhy 写了:/etc/profile.d/*.sh //这个目录下的文件可能有问题
从提示看是第一行出问题。。

诡异。。
^_^ ~~~
要理解递归,首先要理解递归。

地球人都知道,理论上,理论跟实际是没有差别的,但实际上,理论跟实际的差别是相当大滴。
forpeace
帖子: 10
注册时间: 2008-09-27 21:52

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

#7

帖子 forpeace » 2008-11-22 19:58

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

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