.bashrc:语法错误:文件意外结束

德里·拉曼(Dery Rahman A.

我不知道如何解决这个错误。

bash:/home/dery/.bashrc:第168行:语法错误:文件意外结束

这是我的.bashrc

case $- in
    *i*) ;;
      *) return;;
esac

HISTCONTROL=ignoreboth

shopt -s histappend

HISTSIZE=1000
HISTFILESIZE=2000

shopt -s checkwinsize

[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"

if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
    debian_chroot=$(cat /etc/debian_chroot)
fi

case "$TERM" in
    xterm-color) color_prompt=yes;;
esac

if [ -n "$force_color_prompt" ]; then
    if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
        color_prompt=yes
    else
        color_prompt=
    fi
fi

if [ "$color_prompt" = yes ]; then
    PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
    PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
unset color_prompt force_color_prompt

if [ -x /usr/bin/dircolors ]; then
    test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
    alias ls='ls --color=auto'
    alias grep='grep --color=auto'
    alias fgrep='fgrep --color=auto'
    alias egrep='egrep --color=auto'
fi

alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'

alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'

if [ -f ~/.bash_aliases ]; then
    . ~/.bash_aliases
fi

if ! shopt -oq posix; then
  if [ -f /usr/share/bash-completion/bash_completion ]; then
    . /usr/share/bash-completion/bash_completion
  elif [ -f /etc/bash_completion ]; then
    . /etc/bash_completion
  fi
fi

case "$TERM" in
xterm*|rxvt*)
    PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\$(print_title)\a\]$PS1"
    __el_LAST_EXECUTED_COMMAND=""
    print_title () 
    {
        __el_FIRSTPART=""
        __el_SECONDPART=""
        if [ "$PWD" == "$HOME" ]; then
            __el_FIRSTPART=$(gettext --domain="pantheon-files" "Home")
        else
            if [ "$PWD" == "/" ]; then
                __el_FIRSTPART="/"
            else
                __el_FIRSTPART="${PWD##*/}"
            fi
        fi
        if [[ "$__el_LAST_EXECUTED_COMMAND" == "" ]]; then
            echo "$__el_FIRSTPART"
            return
        fi
        #trim the command to the first segment and strip sudo
        if [[ "$__el_LAST_EXECUTED_COMMAND" == sudo* ]]; then
            __el_SECONDPART="${__el_LAST_EXECUTED_COMMAND:5}"
            __el_SECONDPART="${__el_SECONDPART%% *}"
        else
            __el_SECONDPART="${__el_LAST_EXECUTED_COMMAND%% *}"
        fi 
        printf "%s: %s" "$__el_FIRSTPART" "$__el_SECONDPART"
    }
    put_title()
    {
        __el_LAST_EXECUTED_COMMAND="${BASH_COMMAND}"
        printf "\033]0;%s\007" "$1"
    }

    # Show the currently running command in the terminal title:
    # http://www.davidpashley.com/articles/xterm-titles-with-bash.html
    update_tab_command()
    {
        # catch blacklisted commands and nested escapes
        case "$BASH_COMMAND" in 
            *\033]0*|update_*|echo*|printf*|clear*|cd*)
            __el_LAST_EXECUTED_COMMAND=""
                ;;
            *)
            put_title "${BASH_COMMAND}"
            ;;
        esac
    }
    preexec_functions+=(update_tab_command)
    ;;
*)
    ;;
将要

您忘case了用结束脚本esac这留下了一个未case终止的,导致Bash到达文件末尾寻找一个,从而触发此错误。

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

.bashrc语法错误:文件意外结束

来自分类Dev

.bashrc:语法错误:文件意外结束

来自分类Dev

带有原始 .bashrc 的“语法错误:文件意外结束”

来自分类Dev

bash:语法错误:文件意外结束

来自分类Dev

bash:.bashrc:第 148 行:语法错误:文件意外结束

来自分类Dev

解析错误:语法错误,文件意外结束

来自分类Dev

PHP解析错误:语法错误,文件意外结束,应为“`”

来自分类Dev

语法错误:bash中的文件意外结束错误

来自分类Dev

PHP-解析错误:语法错误,文件意外结束

来自分类Dev

PHP:解析错误:语法错误,文件意外结束

来自分类Dev

我收到解析错误:语法错误,文件意外结束

来自分类Dev

解析错误:语法错误、文件意外结束、期望变量

来自分类Dev

解析错误:语法错误,文件意外结束问题

来自分类Dev

Bash配置文件语法错误:文件意外结束

来自分类Dev

.bashrc文件语法错误在意外标记“(”附近

来自分类Dev

postgres脚本困扰语法错误:文件意外结束

来自分类Dev

语法错误:.bash_profile文件意外结束

来自分类Dev

语法错误,文件laravel 5意外结束

来自分类Dev

语法错误:.bash_profile文件意外结束

来自分类Dev

第45行语法错误:文件意外结束

来自分类Dev

PHP脚本:语法错误,文件意外结束

来自分类Dev

语法错误:文件意外结束-Bash脚本

来自分类Dev

语法错误:文件意外结束-Bash脚本

来自分类Dev

语法错误,PHP中文件意外结束

来自分类Dev

第42行:语法错误:文件意外结束

来自分类Dev

语法错误,文件 codeigniter 视图意外结束

来自分类Dev

语法错误,运行 php7 的文件意外结束

来自分类Dev

Bash 语法错误:fi 上的文件意外结束

来自分类Dev

.bashrc:意外令牌'('附近的语法错误

Related 相关文章

  1. 1

    .bashrc语法错误:文件意外结束

  2. 2

    .bashrc:语法错误:文件意外结束

  3. 3

    带有原始 .bashrc 的“语法错误:文件意外结束”

  4. 4

    bash:语法错误:文件意外结束

  5. 5

    bash:.bashrc:第 148 行:语法错误:文件意外结束

  6. 6

    解析错误:语法错误,文件意外结束

  7. 7

    PHP解析错误:语法错误,文件意外结束,应为“`”

  8. 8

    语法错误:bash中的文件意外结束错误

  9. 9

    PHP-解析错误:语法错误,文件意外结束

  10. 10

    PHP:解析错误:语法错误,文件意外结束

  11. 11

    我收到解析错误:语法错误,文件意外结束

  12. 12

    解析错误:语法错误、文件意外结束、期望变量

  13. 13

    解析错误:语法错误,文件意外结束问题

  14. 14

    Bash配置文件语法错误:文件意外结束

  15. 15

    .bashrc文件语法错误在意外标记“(”附近

  16. 16

    postgres脚本困扰语法错误:文件意外结束

  17. 17

    语法错误:.bash_profile文件意外结束

  18. 18

    语法错误,文件laravel 5意外结束

  19. 19

    语法错误:.bash_profile文件意外结束

  20. 20

    第45行语法错误:文件意外结束

  21. 21

    PHP脚本:语法错误,文件意外结束

  22. 22

    语法错误:文件意外结束-Bash脚本

  23. 23

    语法错误:文件意外结束-Bash脚本

  24. 24

    语法错误,PHP中文件意外结束

  25. 25

    第42行:语法错误:文件意外结束

  26. 26

    语法错误,文件 codeigniter 视图意外结束

  27. 27

    语法错误,运行 php7 的文件意外结束

  28. 28

    Bash 语法错误:fi 上的文件意外结束

  29. 29

    .bashrc:意外令牌'('附近的语法错误

热门标签

归档