help-bash
[Top][All Lists]
Advanced

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

Re: [Help-bash] Why `echo !(*.l).c` behaves different depending on the c


From: Chet Ramey
Subject: Re: [Help-bash] Why `echo !(*.l).c` behaves different depending on the context?
Date: Mon, 11 Feb 2019 12:02:19 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.5.0

On 2/11/19 11:57 AM, Peng Yu wrote:
>> This makes no sense at all. Whether or not the shell parses each command
>> in, say, the body of a compound command one at a time (it does, but they
>> are all part of the same command list), it cannot execute any of them until
>> the entire compound command is parsed successfully. Would you want the
>> test in an if statement to be executed, and commands executed on the fly
>> as they are encountered, without a trailing `fi'?
> 
> Then, you can make it fail (and possibly roll back before the
> if-statement). I don't think it is absolutely impossible to do. It is
> just probably difficult to do with the current framework.

`Rolling back' the execution of arbitrary commands is not possible. That's
not going to work the way you think it might.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    address@hidden    http://tiswww.cwru.edu/~chet/



reply via email to

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