help-bash
[Top][All Lists]
Advanced

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

[Help-bash] How to prevent duplicate echo when using set -x?


From: adrelanos
Subject: [Help-bash] How to prevent duplicate echo when using set -x?
Date: Fri, 10 Aug 2012 19:19:19 +0000

Hello!

Here is an example...

script:
#!/bin/bash
set -x
cp x y
echo "Doing this because..."
cp xx yy

Output:
./script
+ cp x y
+ echo 'Doing this because...'
Doing this because...
+ cp xx yy

Can I somehow get ride of the "+ echo 'Doing this because...'"? (They
are simple reminders for myself why I did this and this or for people
who may read my sources.)

I want to let debugging with set -x activate, but not show any comments
twice. Do you know a solution?

Cheers,
adrelanos



reply via email to

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