【问题标题】:Error after open iTerm-zsh or Terminal打开 iTerm-zsh 或终端后出错
【发布时间】:2015-05-01 18:31:51
【问题描述】:
我不确定我昨晚在 iTerm-zsh 上设置了什么。
但是当我在我的 Mac 上打开 iTerm (zsh) 或 Terminal 或者我尝试使用 zsh 之后,
它总是会显示以下内容:
/Users/Simon/google-cloud-sdk/path.bash.inc:3: = not found`
/Users/Simon/google-cloud-sdk/completion.bash.inc:18: command not found: complete
/Users/Simon/google-cloud-sdk/completion.bash.inc:29: parse error near `]]'
有什么想法可以解决这个问题吗?提前致谢。
【问题讨论】:
标签:
macos
installation
zsh
【解决方案1】:
我有同样的问题,但接受的答案将删除 zsh 上的任何配置。但是你可以通过修改bash_profile来修复
vi ~/.bash_profile
跟随变化
if [ -f '[PATH_TO_FOLDER]/google-cloud-sdk/path.bash.inc' ]; then . '[PATH_TO_FOLDER]/google-cloud-sdk/path.bash.inc'; fi
# The next line enables shell command completion for gcloud.
if [ -f '[PATH_TO_FOLDER]/google-cloud-sdk/completion.bash.inc' ]; then . '[PATH_TO_FOLDER]/google-cloud-sdk/completion.bash.inc'; fi
到
if [ -f '[PATH_TO_FOLDER]/google-cloud-sdk/path.zsh.inc' ]; then . '[PATH_TO_FOLDER]/google-cloud-sdk/path.zsh.inc'; fi
# The next line enables shell command completion for gcloud.
if [ -f '[PATH_TO_FOLDER]/google-cloud-sdk/completion.zsh.inc' ]; then . '[PATH_TO_FOLDER]/google-cloud-sdk/completion.zsh.inc'; fi
最后运行
source ~/.bash_profile
【解决方案2】:
重置我的 zsh 配置,删除 .zshrc 和任何 .zshrc 的所有实例。???交换文件解决问题:)
重置命令 -> rm -f ~/.zshrc*
然后关闭我的终端会话并重新打开,我会看到“新用户”屏幕。
【解决方案3】:
如果您使用 Big Sur,请尝试执行以下命令:
. '/your_installation_path/google-cloud-sdk/path.zsh.inc'
. '/your_installation_path/google-cloud-sdk/completion.zsh.inc'