ZSH:采购文件时出现“ setopt:找不到命令”

时间:2020-11-09 21:07:40

标签: zsh zshrc

我正在尝试调试为什么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_configsource时,每个setopt的呼叫都会出现错误:

 setopt: command not found

但是,如果我手动调用setopt(即将行粘贴到终端中),则不会出错。

0 个答案:

没有答案