ubuntu 不可预料的文件末尾

来源:百度知道 编辑:UC知道 时间:2024/09/28 13:16:58
我最近装了一个ubuntu8.04,每次打开终端,都会出现
bash: /home/dzhua/.bashrc: line 78: 语法错误:不可预料的文件末尾
这句话,这是为什么啊,.bashrc总共才77行。 知道的帮帮忙吧!

你看看你的.bashrc文件中各个语句块中if和fi是否是成对出现,如果不是成对匹配,应该会出现这个问题,手工添加if(块的头部)或fi(块的尾部,是if语句的结束标志)即可。
你或许是手工编辑.bashrc文件后出现了一些错误,以下是我的.bashrc文件全部内容,供参考。(本人的系统也是Ubuntu8.04 hardy)

# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples

# If not running interactively, don't do anything
[ -z "$PS1" ] && return

# don't put duplicate lines in the history. See bash(1) for more options
export HISTCONTROL=ignoredups
# ... and ignore same sucessive entries.
export HISTCONTROL=ignoreboth

# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize

# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(lesspipe)"

# set variable identifying the chroot you work in (used