エラー:.bash_profileの「予期しないファイルの終わり」

エラー:.bash_profileの「予期しないファイルの終わり」

実行すると、source ~/.bash_profile次のエラーが発生します。

line 14 syntax error: unexpected end of file

最後の行を削除しようとしましたが、役に立ちませんでした。

# 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

ベストアンサー1

セミコロンの欠落:

if [ "$PS1" ]; then PS1="[\e[0;36m]\W\n[\e[m][\e[1;31m]\$[\e[m]" fi 

しなければならない

if [ "$PS1" ]; then PS1="[\e[0;36m]\W\n[\e[m][\e[1;31m]\$[\e[m]"; fi

ifまたは、上記の他のステートメントと同じ方法でフォーマットします。

おすすめ記事