[Top][All Lists]
[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: |
Sat, 11 Aug 2012 03:21:15 +0000 |
Dennis Williamson:
> On Aug 10, 2012 2:21 PM, "adrelanos" <address@hidden> wrote:
>>
>> 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
>>
>
> What's wrong with # ?
>
# is ignored when running the script, i.e. ./script. I want to see it
while running the script.