首页 > 解决方案 > 在 Bash 中运行最后一个命令已损坏(!!)

问题描述

不知何故,我的 bash rc 脚本(数百行长且审查起来并不简单)正在中断!!,我不知道如何快速调试它。我知道这一点,因为当我在没有用户配置的情况下运行 bash时,它工作正常。我怎样才能快速调试这个,或者有什么想到的?我没有在脚本中运行它——我是从命令行输入的。

$ !!
!!: command not found

$ echo $-
himBs

$ bash --version
GNU bash, version 4.4.20(1)-release (x86_64-pc-linux-gnu)


$ shopt
autocd          off
cdable_vars     off
cdspell         off
checkhash       off
checkjobs       off
checkwinsize    off
cmdhist         on
compat31        off
compat32        off
compat40        off
compat41        off
compat42        off
compat43        off
complete_fullquote  on
direxpand       off
dirspell        off
dotglob         off
execfail        off
expand_aliases  on
extdebug        off
extglob         on
extquote        on
failglob        off
force_fignore   on
globasciiranges off
globstar        off
gnu_errfmt      off
histappend      off
histreedit      off
histverify      off
hostcomplete    off
huponexit       off
inherit_errexit off
interactive_comments    on
lastpipe        off
lithist         off
login_shell     on
mailwarn        off
no_empty_cmd_completion off
nocaseglob      off
nocasematch     off
nullglob        off
progcomp        on
promptvars      on
restricted_shell    off
shift_verbose   off
sourcepath      on
xpg_echo        off

标签: bash

解决方案


推荐阅读