On Thu, Sep 25, 2025, at 11:45 PM, Duncan Roe via Bug reports for the GNU 
Bourne Again SHell wrote:
> The last *list* in a case command may be terminated by a single ';', but all
> other lists must be terminated by ';;'.
>
> [...]
>
> Does this just "happen to work"?

No, POSIX requires it:

        The format for the case construct is as follows:

        case word in
            [[(] pattern[ | pattern] ... ) compound-list terminator] ...
            [[(] pattern[ | pattern] ... ) compound-list]
        esac

        Where _terminator_ is either ";;" or ";&" and is optional
        for the last compound-list.

https://pubs.opengroup.org/onlinepubs/9799919799.2024edition/utilities/V3_chap02.html#tag_19_09_04_05

P.S.  In the future it would be helpful for list subscribers and
readers of the list archive if you changed the email subject when
you post digressions like this.

-- 
vq

  • "set -e&quo... Stan Marsh
    • Re: "s... Lawrence Velázquez
    • Re: "s... Duncan Roe via Bug reports for the GNU Bourne Again SHell
      • Re: &qu... Lawrence Velázquez
        • Sou... Duncan Roe via Bug reports for the GNU Bourne Again SHell

Reply via email to