bug-bash
[Top][All Lists]
Advanced

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

Typo in `case in pattern` command description in manpages


From: Andy Li
Subject: Typo in `case in pattern` command description in manpages
Date: Thu, 19 Nov 2026 22:17:53 +0000

Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -march=x86-64 -mtune=generic -O2 -pipe -fno-plt
-fexceptions         -Wp,-D_FORTIFY_SOURCE=3 -Wformat
-Werror=format-security         -fstack-clash-protection -fcf-protection
      -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g
-ffile-prefix-map=/build/bash/src=/usr/src/debug/bash -flto=auto
-DDEFAULT_PATH_VALUE='/usr/local/sbin:/usr/local/bin:/usr/bin'
-DSTANDARD_UTILS_PATH='/usr/bin' -DSYS_BASHRC='/etc/bash.bashrc'
-DSYS_BASH_LOGOUT='/etc/bash.bash_logout' -DNON_INTERACTIVE_LOGIN_SHELLS
-std=gnu17
uname output: Linux archlinux 7.3.4-arch1-1 #1 SMP PREEMPT_DYNAMIC Wed, 11
Nov 2026 19:02:39 +0000 x86_64 GNU/Linux
Machine Type: x86_64-pc-linux-gnu

Bash Version: 5.3
Patch Level: 20
Release Status: release

Description:

In the bash man page, the expression describing the grammar for the `case`
construct suggests that patterns should be separated with `|`:

```
case word in [ [(] pattern [ | pattern ] ... ) list ;; ] ... esac
```

i.e., `case word in $list1|$list2` could be a way to check if word is in
either one of `$list1` or `$list2`. , but the description following the
expression contains

```txt
A  pattern list is a set of one or more patterns separated by , and the )
operator terminates the pattern list.
```

i.e., that the patterns should be separated by `,`.

When testing in bash I saw that while `,` did not work, `|` worked.

Repeat-By:
N/A

Fix:
Replace `,` with `|` in `A  pattern list is a set of one or more patterns
separated by , and the ) operator terminates the pattern list.` in the
manpages.


reply via email to

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