weird ZSH issue (resolving environment variable)
As explained in https://stackoverflow.com/questions/56951712/why-is-zsh-not-able-to-read-tilde-from-a-path-in-a-script zsh doesn't expand ~ within double quotes. So you can do one of
export ZSH=~&quot;/.oh-my-zsh&quot;
export ZSH=&quot;$HOME/.oh-my-zsh&quot;

(where the second option also works if there are space characters in your home path), or set
set -o magicequalsubst

to have zsh expand ~ in such cases.