help-bash
[Top][All Lists]
Advanced

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

Re: Set verbose Flag Inside if-block


From: Sysadmin Lists
Subject: Re: Set verbose Flag Inside if-block
Date: Sun, 16 Apr 2023 22:46:38 +0200 (CEST)

> ----------------------------------------
> From: Chet Ramey <chet.ramey@case.edu>
> Date: Apr 16, 2023, 1:08:56 PM
> To: Sysadmin Lists <sysadmin.lists@mailfence.com>, <help-bash@gnu.org>
> Cc: <chet.ramey@case.edu>
> Subject: Re: Set verbose Flag Inside if-block
> 
> 
> On 4/16/23 2:24 PM, Sysadmin Lists wrote:
> 
> > That's not what's happening. Breaking up that command line into newlines 
> > shows
> > the bug.  The first version should echo everything inside the if-statement 
> > after the
> >   'set -ve' but doesn't. 
> 
> It should not.

It should. It'd be useful to only echo commands inside the if-block if we get 
there.

> > It's treating the entire if-block as a single command.
> 
> The if command is a single compound command that is read and parsed in its
> entirety before any of it is executed.

Why can't the same logic used for the -x flag apply to the -v flag here? It'd 
make sense.
 
> -- 
> ``The lyf so short, the craft so long to lerne.'' - Chaucer
>                ``Ars longa, vita brevis'' - Hippocrates
> Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/
> 

-- 
Sent with https://mailfence.com  
Secure and private email



reply via email to

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