0
在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
錯誤發生在倒數第二個fi
聲明中。的確,看起來最後兩個fi
s沒有與任何if
匹配。我只能評論最後三行,但我不確定是否會打破功能。有什麼建議?
爲什麼最後3條線沒有任何邏輯? – Inian
這讓我感到困惑。 Google似乎不太可能會發送帶有語法錯誤的代碼,但這些行似乎已被安裝程序添加。 –