[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: |
Peng Yu |
Subject: |
Re: [Help-bash] Why `echo !(*.l).c` behaves different depending on the context? |
Date: |
Fri, 8 Feb 2019 23:04:58 -0600 |
On Fri, Feb 8, 2019 at 10:19 PM Eduardo Bustamante <address@hidden> wrote:
>
> On Fri, Feb 8, 2019 at 8:04 PM Peng Yu <address@hidden> wrote:
> (...)
> > See below. `echo !(*.l).c` sometimes is OK but sometimes it is an
> > error. Is it a correct behavior?
>
> Yes. "extglob" changes the behavior of the parser. This behavior is
> correct and expected. Read: https://mywiki.wooledge.org/glob#extglob
I am not sure this link is relevant.
In both main.sh, extglob is enabled, the difference is in the `if`.
Why `if` can cause the code to be grammatically incorrect, but
removing`if` the code will be OK?
--
Regards,
Peng
- [Help-bash] Why `echo !(*.l).c` behaves different depending on the context?, Peng Yu, 2019/02/08
- Re: [Help-bash] Why `echo !(*.l).c` behaves different depending on the context?, Eduardo Bustamante, 2019/02/08
- Re: [Help-bash] Why `echo !(*.l).c` behaves different depending on the context?,
Peng Yu <=
- Re: [Help-bash] Why `echo !(*.l).c` behaves different depending on the context?, Eduardo Bustamante, 2019/02/09
- Re: [Help-bash] Why `echo !(*.l).c` behaves different depending on the context?, Peng Yu, 2019/02/09
- Re: [Help-bash] Why `echo !(*.l).c` behaves different depending on the context?, Peng Yu, 2019/02/09
- Re: [Help-bash] Why `echo !(*.l).c` behaves different depending on the context?, Chet Ramey, 2019/02/11
- Re: [Help-bash] Why `echo !(*.l).c` behaves different depending on the context?, Peng Yu, 2019/02/11
- Re: [Help-bash] Why `echo !(*.l).c` behaves different depending on the context?, Chet Ramey, 2019/02/11
- Re: [Help-bash] Why `echo !(*.l).c` behaves different depending on the context?, Peng Yu, 2019/02/11
- Re: [Help-bash] Why `echo !(*.l).c` behaves different depending on the context?, Chet Ramey, 2019/02/11
- Re: [Help-bash] Why `echo !(*.l).c` behaves different depending on the context?, Peng Yu, 2019/02/12