help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-bash] set -v but with PS4 add to the front


From: Peng Yu
Subject: [Help-bash] set -v but with PS4 add to the front
Date: Sun, 7 Oct 2012 11:00:42 -0500

Hi,

I want to print the command automatically with an extra + in the
front. 'set -x' can add PS4, but it print piped commands into multiple
lines. Is there a way to add '+' automatically when 'set -v' is
enabled?

/tmp$ ./test.sh
echo hello | cat
hello
set +v
+ echo hello
+ cat
hello
/tmp$ cat test.sh
#!/usr/bin/env bash

set -v
echo hello | cat
set +v

set -x
echo hello | cat



-- 
Regards,
Peng



reply via email to

[Prev in Thread] Current Thread [Next in Thread]