替换 set -x 命令提示符上的加号

rub*_*o77 2 bash

我set -x在脚本中使用它们在执行时输出行。

我想在那里添加一些评论,所以我使用了:命令,它什么都不做

: :::: comment here
Run Code Online (Sandbox Code Playgroud)

看起来不错,但是如果其他行也有前面的:,而不是+每一行的前面,那看起来会更好。

如何更改加号?

ste*_*ver 6

您可以设置PS4shell 变量。来自man bash:

  PS4    The value of this parameter is expanded  as  with  PS1  and  the
          value  is  printed  before  each command bash displays during an
          execution trace.  The first character of PS4 is replicated  mul?
          tiple  times, as necessary, to indicate multiple levels of indi?
          rection.  The default is ``+ ''.
Run Code Online (Sandbox Code Playgroud)