当我执行时,source ~/.bash_profile我收到此错误:
line 14 syntax error: unexpected end of file
Run Code Online (Sandbox Code Playgroud)
我试图删除最后一行无济于事。
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
if [ -f ~/.git-completion.bash ]; then
source ~/.git-completion.bash
fi
PS1='\[\e[0;36m\]\W\[\e[m\]\[\e[1;31m\]\$\[\e[m\]'
if [ "$PS1" ]; then PS1="[\e[0;36m]\W\n[\e[m][\e[1;31m]\$[\e[m]" fi
function gi() { curl -L -s https://www.gitignore.io/api/$@ ;}
export LSCOLORS=cxfxcxdxbxegedabagacad
Run Code Online (Sandbox Code Playgroud)
小智 5
缺少一个分号:
if [ "$PS1" ]; then PS1="[\e[0;36m]\W\n[\e[m][\e[1;31m]\$[\e[m]" fi
Run Code Online (Sandbox Code Playgroud)
应该
if [ "$PS1" ]; then PS1="[\e[0;36m]\W\n[\e[m][\e[1;31m]\$[\e[m]"; fi
Run Code Online (Sandbox Code Playgroud)
或者,按照与if上面的其他语句相同的方式对其进行格式化。
| 归档时间: |
|
| 查看次数: |
5625 次 |
| 最近记录: |