Thi*_*ros 18 shell zsh zshrc oh-my-zsh
今天我升级了我的oh-my-zsh,然后开始出现这个错误:
~/.oh-my-zsh/lib/misc.zsh:3: parse error near `then'
在这个文件里面有这个shell循环......
## Load smart urls if available
for d in $fpath; do
if [[ -e "$url/d-quote-magic"]]; then
autoload -U url-quote-magic
zle -N self-insert url-quote-magic
fi
done
Run Code Online (Sandbox Code Playgroud)
我认为问题在于if条件,但我没有shell/zsh技能:(任何人都可以帮我这个吗?非常感谢!:)
Thi*_*ros 24
Etan Reisner帮助我解释他的评论.
You need a space between the " and the ]] in that if line.
所以我只需添加一个空格:')并修复警告!:P
for d in $fpath; do
if [[ -e "$url/d-quote-magic" ]]; then
autoload -U url-quote-magic
zle -N self-insert url-quote-magic
fi
done
Run Code Online (Sandbox Code Playgroud)
再次感谢!:)