.bash_profile syntax error: unexpected end of file

前端 未结 2 1770
清歌不尽
清歌不尽 2020-12-07 03:56

OS: macOS Sierra v10.12.2

I was trying to get R working from the command line and ran into this problem, probably because I am relatively new to coding and messed wi

相关标签:
2条回答
  • 2020-12-07 04:16

    You are missed semicolon (;) at line number 27:

    precmd () { PS1="${ORANGE}[%~] ${GREEN}$(prompt_ruby_info) ${NORMAL}$ "; }
    
    0 讨论(0)
  • 2020-12-07 04:26

    This line :

    precmd () { PS1="${ORANGE}[%~] ${GREEN}$(prompt_ruby_info) ${NORMAL}$ " }
    

    Misses a semi-colon at the end :

    precmd () { PS1="${ORANGE}[%~] ${GREEN}$(prompt_ruby_info) ${NORMAL}$ " ; }
    

    From the Bash reference manual :

    { list; }

    Placing a list of commands between curly braces causes the list to be executed in the current shell context. No subshell is created. The semicolon (or newline) following list is required.

    This means you could also write :

    precmd ()
    {
      PS1="${ORANGE}[%~] ${GREEN}$(prompt_ruby_info) ${NORMAL}$ "
    }
    
    0 讨论(0)
提交回复
热议问题