[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: syntax error while parsing a case command within `$(...)'
From: |
Koichi Murase |
Subject: |
Re: syntax error while parsing a case command within `$(...)' |
Date: |
Tue, 16 Feb 2021 06:39:44 +0800 |
2021年2月16日(火) 5:12 Chet Ramey <chet.ramey@case.edu>:
> It is unexpected, though the syntax is obscure. I'll fix it.
If this is to be fixed, maybe also the following cases could be
handled better (if the corresponding fixes are not too complicated).
bash -c ': $(case x in esac)'
bash -c ': $(case x in (x) if :; then echo a; fi esac)'
bash -c ': $(case x in (x) a() { echo a; } esac)'
bash -c ': $(case x in (x) for ((i=0;i<10;i++)) { echo a; } esac)'
I know that those are also undocumented (AFAIK) and obscure cases, but
they are all accepted outside the command substitution. Also, the
following similar cases are currently handled without syntax errors as
expected.
bash -c ': $(case x in (x) while false; do echo a; done esac)'
bash -c ': $(case x in (x) case y in (y) echo a;; esac esac)'
--
Koichi
- Re: syntax error while parsing a case command within `$(...)', (continued)
- Re: syntax error while parsing a case command within `$(...)', Lawrence Velázquez, 2021/02/14
- Re: syntax error while parsing a case command within `$(...)', Dale R. Worley, 2021/02/16
- Re: syntax error while parsing a case command within `$(...)', Lawrence Velázquez, 2021/02/17
- Re: syntax error while parsing a case command within `$(...)', Dale R. Worley, 2021/02/17
- Re: syntax error while parsing a case command within `$(...)', Lawrence Velázquez, 2021/02/18
Re: syntax error while parsing a case command within `$(...)', Eli Schwartz, 2021/02/14
Re: syntax error while parsing a case command within `$(...)', Chet Ramey, 2021/02/15
- Re: syntax error while parsing a case command within `$(...)',
Koichi Murase <=
- Re: syntax error while parsing a case command within `$(...)', Chet Ramey, 2021/02/15
- Re: syntax error while parsing a case command within `$(...)', Oğuz, 2021/02/16
- Re: syntax error while parsing a case command within `$(...)', Koichi Murase, 2021/02/16
- Re: syntax error while parsing a case command within `$(...)', Oğuz, 2021/02/16
- Re: syntax error while parsing a case command within `$(...)', Koichi Murase, 2021/02/16
- Re: syntax error while parsing a case command within `$(...)', Andreas Schwab, 2021/02/16
- Re: syntax error while parsing a case command within `$(...)', Koichi Murase, 2021/02/16
- Re: syntax error while parsing a case command within `$(...)', Oğuz, 2021/02/16
- Re: syntax error while parsing a case command within `$(...)', Koichi Murase, 2021/02/16
- Re: syntax error while parsing a case command within `$(...)', Oğuz, 2021/02/16