ohmyzsh: source ~/.zshrc error

hank@AT9474-DLP:~$ --> source ~/.zshrc
-bash: autoload: command not found
-bash: /Users/hank/.oh-my-zsh/oh-my-zsh.sh: line 41: syntax error near unexpected token `('
-bash: /Users/hank/.oh-my-zsh/oh-my-zsh.sh: line 41: `for plugin($plugins); do'

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 22 (6 by maintainers)

Most upvoted comments

@huangjihua, @mcornella There are steps which helped me:

  • zsh
  • chsh -s $(which zsh)
  • Logout from the system and login
  • Run terminal It works for me now.

You should be running zsh instead of bash. Run zsh, and chsh -s $(which zsh) if you want to have zsh as the default shell.

Running zsh v5.8 and having this issue. Have followed all steps listed and can confirm am running zsh. Oh-My-Zsh is not running, and running oh-my-zsh.sh exits with:

/home/ghost/.oh-my-zsh/tools/check_for_upgrade.sh: line 32: syntax error near unexpected token `)'
/home/ghost/.oh-my-zsh/tools/check_for_upgrade.sh: line 32: `() {'
./oh-my-zsh.sh: line 21: autoload: command not found
./oh-my-zsh.sh: line 39: syntax error near unexpected token `('
./oh-my-zsh.sh: line 39: `for plugin ($plugins); do'

Seems to be the same issue, have been unable to troubleshoot. Thoughts?

@huangjihua, @mcornella There are steps which helped me:

  • zsh
  • chsh -s $(which zsh)
  • Logout from the system and login
  • Run terminal It works for me now. It works. Thank you!!

Mac terminal has an option to use other shell rather than default shell. It will cause the same behavior.

Change it from Terminal -> Preference -> General -> Shell open with (Default login shell)

@akabuda050 Thank you mate!

@akabuda050 Thank you!!!