bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: syntax error while parsing a case command within `$(...)'


From: Lawrence Velázquez
Subject: Re: syntax error while parsing a case command within `$(...)'
Date: Sun, 14 Feb 2021 15:11:43 -0500

> On Feb 14, 2021, at 3:00 PM, Oğuz <oguzismailuysal@gmail.com> wrote:
> 
> 14 Şubat 2021 Pazar tarihinde Dale R. Worley <worley@alum.mit.edu> yazdı:
> 
>> Before we worry about what to change, I want to note that the original
>> example is syntactically incorrect.  The example is
>> 
>>  $ bash -c ': $(case x in x) esac)'
>> 
>> But the manual page makes it clear that each case must be ended with
>> ";;".
> 
> 
> `;;' is optional for the last case item.

For reference:
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_09_04_05

For comparison:

        % ksh -c ': $(case x in x) esac)'; echo $?
        0
        % zsh -c ': $(case x in x) esac)'; echo $?
        0
        % dash -c ': $(case x in x) esac)'; echo $?
        0
        % yash -c ': $(case x in x) esac)'; echo $?
        0
        % bash -c ': $(case x in x) esac)'; echo $?
        bash: -c: line 1: unexpected EOF while looking for matching `)'
        bash: -c: line 2: syntax error: unexpected end of file
        2

vq


reply via email to

[Prev in Thread] Current Thread [Next in Thread]