在跟随互联网上的一些随机指示,尝试在shell上调试我的问题(我使用zsh),我跑了set -x
.多亏了这一点,我想出了我的问题.然而,我现在处于一个尴尬的位置,不知道如何关闭这个调试 - 我真的甚至不了解我在一开始就做了什么,你看.
我也想到我可以做zsh
一个新的shell.显而易见的unset -x
是行不通的.我想知道正确的方法.谢谢!
更新:
发现这个 unix和linux堆栈的交换帖子讲的是什么-x
.仍然不知道如何关闭它.
您可以使用set +x
它将其切换回来.输出help set
描述了这个:
$ help set set: set [--abefhkmnptuvxBCHP] [-o option] [arg ...] ... -v Print shell input lines as they are read. -x Print commands and their arguments as they are executed. ... Using + rather than - causes these flags to be turned off. The flags can also be used upon invocation of the shell. The current set of flags may be found in $-. The remaining n ARGs are positional parameters and are assigned, in order, to $1, $2, .. $n. If no ARGs are given, all shell variables are printed.
注意"使用+
而不是-
使这些标志关闭"部分.