On Fri, Mar 31, 2023, 3:02 PM Martin Schulte <g...@schrader-schulte.de> wrote:
> Hi Dennis, > > thanks for your answer! > > > This isn't regex. > > Sure! > > > 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. > > I would be interested in an example! > > Best regards, > > Martin > Examples of man pages and help text: man man man grep grep -h man find man ssh ssh --help man lsof lsof -h An example of the synopsis section of the lsof man page Revision-4.91 on my Mac: SYNOPSIS lsof [ -?abChlnNOPRtUvVX ] [ -A A ] [ -c c ] [ +c c ] [ +|-d d ] [ +|-D D ] [ +|-e s ] [ +|-E ] [ +|-f [cfgGn] ] [ -F [f] ] [ -g [s] ] [ -i [i] ] [ -k k ] [ -K k ] [ +|-L [l] ] [ +|-m m ] [ +|-M ] [ -o [o] ] [ -p s ] [ +|-r [t[m<fmt>]] ] [ -s [p:s] ] [ -S [t] ] [ -T [t] ] [ -u s ] [ +|-w ] [ -x [fl] ] [ +|-X ] [ -z [z] ] [ -Z [Z] ] [ -- ] [names] Part of the output of lsof -h: usage: [-?abhlnNoOPRtUvVX] [+|-c c] [+|-d s] [+D D] [+|-f[cgG]] [-F [f]] [-g [s]] [-i [i]] [+|-L [l]] [+|-M] [-o [o]] [-p s] [+|-r [t]] [-s [p:s]] [-S [t]] [-T [t]] [-u s] [+|-w] [-x [fl]] [--] [names] (Side notes: the missing spaces are just as it was output, some options aren't shown in the help output, -e for example) I apologize if the formatting of the preceding is unreadable. They are direct copy/pastes. >