我正在尝试调试为什么setopt
调用在我尝试进行脚本source
时失败的原因:
/Users/.../.shell_config: line 6: setopt: command not found
这是配置:
zshrc
:# Load the shell dotfiles
for file in $HOME/.{shell_exports,shell_aliases,shell_functions,shell_config}; do
[ -r "$file" ] && [ -f "$file" ] && source "$file";
done;
unset file;
shell_config
:# History
HISTFILE=~/.zsh_history
HISTSIZE=1000
SAVEHIST=1000
setopt inc_append_history
setopt hist_ignore_all_dups
setopt extended_glob
unsetopt share_history
unsetopt beep
zstyle :bracketed-paste-magic paste-init pasteinit
zstyle :bracketed-paste-magic paste-finish pastefinish
当shell_config
被source
时,每个setopt
的呼叫都会出现错误:
setopt: command not found
但是,如果我手动调用setopt
(即将行粘贴到终端中),则不会出错。