我想在Mac上安装谷歌云SDK(以下https://cloud.google.com/sdk/docs/quickstart-mac-os-x),使用install.sh
脚本:如何为gcloud启用shell命令完成?
~/Downloads$ ./google-cloud-sdk/install.sh
在记录的输出,我看到了如下说明:
==> Source [/Users/kurtpeek/Downloads/google-cloud-sdk/completion.bash.inc] in your profile to enable shell command completion for gcloud.
==> Source [/Users/kurtpeek/Downloads/google-cloud-sdk/path.bash.inc] in your profile to add the Google Cloud SDK command line tools to your $PATH.
事实上,我发现使用gsutil
命令仍然会导致-bash: gsutil: command not found
错误,所以我仍然可能必须执行此步骤。
但是,这并不完全清楚,但是,这些说明是什么意思。我在Mac上,我的bash配置文件是~/.bash_profile
。为了使命令行完成工作,我需要添加哪些行?
更新
第一次我安装我没有用sudo
。与sudo
重新安装,我得到一个额外的提示是否修改我的bash的个人资料,这在接受导致以下行添加到我的.bash_profile
:
# The next line updates PATH for the Google Cloud SDK.
if [ -f '/Users/kurtpeek/Downloads/google-cloud-sdk/path.bash.inc' ]; then source '/Users/kurtpeek/Downloads/google-cloud-sdk/path.bash.inc'; fi
# The next line enables shell command completion for gcloud.
if [ -f '/Users/kurtpeek/Downloads/google-cloud-sdk/completion.bash.inc' ]; then source '/Users/kurtpeek/Downloads/google-cloud-sdk/completion.bash.inc'; fi
但是,我仍然得到gsutil: command not found
错误。
您能不能告诉我们'这gsutil'的输出? – Inian
'哪个gsutil'不会输出... –