我set -x在终端输入。
现在终端继续打印在我的输出顶部运行的最后一个命令,因此命令
~]$echo "this is what I see"
Run Code Online (Sandbox Code Playgroud)
返回
+ echo 'this is what I see'
this is what I see
Run Code Online (Sandbox Code Playgroud)
没有手册页set,我该如何set -x关闭?
Gil*_*il' 94
使用set +x. 更多信息:
$ type set
set is a special shell builtin
Run Code Online (Sandbox Code Playgroud)
由于set是内置的 shell,因此它记录在您的 shell 文档中。
请注意,某些系统具有 shell 内置程序的手册页,但这些手册页仅在您使用默认 shell 时才是正确的。在 Linux 上,您可能有提供 POSIX 命令的手册页,这些手册页会出现在 shell 内置命令中,因为没有独立实用程序的手册页来隐藏它们;这些手册页适用于所有 Bourne 风格的 shell(dash、bash、*ksh 甚至 zsh),但通常不完整。
有关在长 shell 手册页中搜索内置程序的提示,请参阅阅读和搜索长手册页。
在这种情况下,所有 Bourne 风格的 shell 的答案都是一样的。如果打开一个选项,请将其关闭。因此,关闭跟踪。读取的最后一个跟踪是不可避免的(除非让 shell 退出——有时你可以使用 subshell )。set -LETTERset +LETTERset +xset +x(set -x; command to trace; other command to trace); command that is not traced