help-bash
[Top][All Lists]
Advanced

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

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


From: Stephane Chazelas
Subject: Re: [Help-bash] How to prevent duplicate echo when using set -x?
Date: Fri, 10 Aug 2012 20:29:19 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

2012-08-10 19:19:19 +0000, adrelanos:
> 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?
[...]

What about

: Doing this because

?

-- 
Stephane




reply via email to

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