微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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

如何解决ZSH:采购文件时出现“ setopt:找不到命令” zshrc: shell_config:

我正在尝试调试为什么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(即将行粘贴到终端中),则不会出错。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。