[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: |
Sun, 14 Feb 2021 17:00:06 +0800 |
2021年2月14日(日) 15:41 Andreas Kusalananda Kähäri <andreas.kahari@abc.se>:
> And using (x) doesn't help:
>
> % bash -c ': $(case x in (x) esac)'
> bash: -c: line 1: unexpected EOF while looking for matching `)'
> bash: -c: line 2: syntax error: unexpected end of file
This is interesting. I think this is just an oversight. A quick fix
like the attached patch should be fine. [ Note: The patch seems to
work fine, but I haven't carefully read the code, so I'm not sure if
this fix is really correct. ]
2021年2月14日(日) 6:23 Robert Elz <kre@munnari.oz.au>:
> [...]
>
> This problem has been known for a LONG time, without it being fixed.
I guess you are using Bash for so many years, but it was fixed in Bash
4.0 (2009). You can see the result of the following command:
$ bash-4.0 -c ': $(case x in x) :; esac)'
2021年2月14日(日) 6:23 Robert Elz <kre@munnari.oz.au>:
> Fixing it would take major work in the parser, so the chances of it
> happening are not all that great.
The case reported here appears to be just an oversight in the fix of
Bash 4.0, so I guess an additional fix should be relatively easy.
--
Koichi
0001-fix-parsing-of-case-x-in-x-esac.patch
Description: Binary data
- syntax error while parsing a case command within `$(...)', Oğuz, 2021/02/13
- Re: syntax error while parsing a case command within `$(...)', Robert Elz, 2021/02/13
- Re: syntax error while parsing a case command within `$(...)', Robert Elz, 2021/02/14
- Re: syntax error while parsing a case command within `$(...)', Stephane Chazelas, 2021/02/14
- Re: syntax error while parsing a case command within `$(...)', Robert Elz, 2021/02/14
- Re: syntax error while parsing a case command within `$(...)', Oğuz, 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 `$(...)', Oğuz, 2021/02/13
Re: syntax error while parsing a case command within `$(...)', Lawrence Velázquez, 2021/02/13
Re: syntax error while parsing a case command within `$(...)', Chet Ramey, 2021/02/15