[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Set verbose Flag Inside if-block
From: |
Chet Ramey |
Subject: |
Re: Set verbose Flag Inside if-block |
Date: |
Sun, 16 Apr 2023 16:08:56 -0400 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 |
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'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.
--
``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/
Re: Set verbose Flag Inside if-block, Sysadmin Lists, 2023/04/17