On Fri, Mar 31, 2023, 2:47 PM Martin Schulte <g...@schrader-schulte.de> wrote:
> Hi Chet! > > > >> Thanks for the report. The synopsis should read > > >> > > >> cd [-L|[-P [-e]]] [-@] [dir] > > > ^ ^ > > > But aren't these two brackets just superfluous? > > > > -L and -P are mutually exclusive, and -e is valid only when -P is > > supplied. > > Yes, my feeling was just that | has such a low precedence that the marked > pair of brackets could be omitted, like in > id|cut -c1-3 > or in the ERE > ^(-L|-P( -e)?)?$ > > But situation seems to be different here. > > Best regards, > > Martin > This isn't regex. It's a command synopsis using a long standing notation style. You can see it set out in POSIX in https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap12.html#tag_12 You'll see this used in many man pages, usage messages and other documentation. It's by no means specific to Bash.