如何合并set -x
和set -v
?ash
(或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