合并集 x (xtrace) 和 v(详细)

合并集 x (xtrace) 和 v(详细)

如何合并set -xset -vash(或set -v带有前缀)

换句话说,在运行时回显命令。

DEBUG信号不存在于ash:中DEBUG: invalid signal specification

set -x

$ echo > foo.txt # Normal
$ set -x
$ echo > foo.txt # Example
+ echo
$ # Missing "> foo.txt # Example"

set -v

$ echo > foo.txt # Normal
$ set -v
$ echo > foo.txt # Example
echo > foo.txt # Example
$ # Missing prefix "> "

set -xv

$ echo > foo.txt # Normal
$ set -vx
$ echo > foo.txt # Example
echo > foo.txt # Example
+ echo
$ # Now there are two problems... (missing "> foo.txt  # Example" and missing prefix "> ")

期望的

$ echo > foo.txt # Normal
$ magic_command "> "
$ echo > foo.txt # Example
> echo > foo.txt # Example
$ ls
> ls
foo.txt

相关内容