[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: |
Dennis Williamson |
Subject: |
Re: [Help-bash] How to prevent duplicate echo when using set -x? |
Date: |
Fri, 10 Aug 2012 16:11:53 -0500 |
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 # ?