0

I am not sure what I've set on my iTerm-zsh last night.

But after I open iTerm (zsh) or Terminal on my Mac or I try to use zsh, it will always show the following:

/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 `]]'

Any ideas that I can fix this ? Thanks in advance.

JL-HaiNan
  • 1,004
  • 9
  • 20

3 Answers3

4

I had same issue but accepted answer will remove any configuration on zsh. But You can fix by modifying bash_profile

vi ~/.bash_profile

change following

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

to

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

lastly run

source ~/.bash_profile
Zeedia
  • 1,313
  • 14
  • 20
0

Reset my zsh configuration, remove all instances of .zshrc and any .zshrc.??? swap files solve the problem :)

Command to reset -> rm -f ~/.zshrc*

Then close my terminal session and re-open, and I get the "new user" screen.

JL-HaiNan
  • 1,004
  • 9
  • 20
0

If you are using Big Sur try to execute these commands:

. '/your_installation_path/google-cloud-sdk/path.zsh.inc'
. '/your_installation_path/google-cloud-sdk/completion.zsh.inc'