Linuxマシンでは、https://cloud.google.com/storage/docs/gsutil_installの指示に従ってgsutilをインストールしようとしています。インストール中に、私はすべてに「はい」と答え、デフォルト値にしました。私は新しいターミナルを開いている場合gsutilのインストール後の.bashrcの構文エラー
は今しかし、それはbashのエラーで始まる:
bash: /home/kurt/.bashrc: line 119: syntax error near unexpected token `fi'
bash: /home/kurt/.bashrc: line 119: `fi'
[email protected]:~$
行が私の.bashrc
ファイルの次のスニペットに含まれている問題:
# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
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
source '/home/kurt/Downloads/google-cloud-sdk/path.bash.inc'
fi
source '/home/kurt/Downloads/google-cloud-sdk/completion.bash.inc'
fi
エラー2番目に最後のfi
ステートメントで発生します。実際、fi
の最後の2つはif
と一致していないようです。私はちょうど最後の3行をコメントすることができますが、それが機能を壊すかどうかはわかりません。何かアドバイス?
最後の3行がロジックなしでぶら下がっているのはなぜですか? – Inian
それも私を困惑させる。 Googleが構文エラーを含むコードを発送することはまず考えられないが、これらの行はインストールプログラムによって追加されたようだ。 –