Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #15380

Incorrect example for `[[` command.

From hk <hkadeveloper@gmail.com>
Newsgroups gnu.bash.bug
Subject Incorrect example for `[[` command.
Date 2019-09-20 13:40 +0800
Message-ID <mailman.590.1568982278.2190.bug-bash@gnu.org> (permalink)
References <CAD0rTC7W20s7-8np7Z+CmZQczTQ+LX=Y1x01gAenewrpiJS5jw@mail.gmail.com>

Show all headers | View raw


Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -g -O2 -Wno-parentheses -Wno-format-security
uname output: Linux hk 4.15.0-62-generic #69-Ubuntu SMP Wed Sep 4 20:55:53
UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Machine Type: x86_64-pc-linux-gnu

Bash Version: 5.0
Patch Level: 0
Release Status: release

Description:
        On section 3.2.4.2 of Bash Reference Manual, the example on*
[[...]]* (page 13 in the PDF) is incorrect. Specifically, the example say *[[
$line =~ [[:space:]]*?(a)b ]]*  will match values like *'aab'* and*
'aaaaaab*'. But it won't. The operator is* =~*, but the operand on the
right side is a pattern while it should be a regular expression.

Repeat-By:
        [Describe the sequence of events that causes the problem
        to occur.]

Fix:
        [Description of how to fix the problem.  If you don't know a
        fix for the problem, don't include this section.]

Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread


Thread

Incorrect example for `[[` command. hk <hkadeveloper@gmail.com> - 2019-09-20 13:40 +0800

csiph-web