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: adrelanos
Subject: Re: [Help-bash] How to prevent duplicate echo when using set -x?
Date: Fri, 10 Aug 2012 19:44:40 +0000

Stephane Chazelas:
> 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
> 
> ?
> 

Very well! Thanks!



reply via email to

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