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. Your example is one, perhaps the most common (and is why the optional leading '(' in case patterns was added to the syntax - so it is possible to survive with shells that work this way, but ')' in a here doc in the command substitution is another). This problem has been known for a LONG time, without it being fixed. Fixing it would take major work in the parser, so the chances of it happening are not all that great. kre