On Sun, Feb 14, 2021 at 12:02:02AM +0100, Andreas Schwab wrote: > On Feb 14 2021, Robert Elz wrote: > > > Date: Sat, 13 Feb 2021 23:21:36 +0300 > > From: =?UTF-8?B?T8SfdXo=?= <oguzismailuy...@gmail.com> > > Message-ID: > > <CAH7i3LrrtgJSZWXFK_5zSNvTwTue9a9j7K=iC=lw2pbpecw...@mail.gmail.com> > > > > | $ bash -c ': $(case x in x) esac)' > > > > This is a well known bash deficiency. When parsing command substitutions > > it (approximately) simply counts (unquoted) parentheses to find the end. > > Anything with a valid closing ')' but with no opening '(' confuses it. > > Bash already handles that properly, when the compound-list is non-empty. > > $ bash -c ': $(case x in x) :; esac)' > > Andreas.
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 -- Andreas (Kusalananda) Kähäri SciLifeLab, NBIS, ICM Uppsala University, Sweden .