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


Groups > gnu.bash.bug > #15578 > unrolled thread

Re: quote removal issues within character class

Started byRobert Elz <kre@munnari.OZ.AU>
First post2019-11-09 06:52 +0700
Last post2019-11-09 06:52 +0700
Articles 1 — 1 participant

Back to article view | Back to gnu.bash.bug

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: quote removal issues within character class Robert Elz <kre@munnari.OZ.AU> - 2019-11-09 06:52 +0700

#15578 — Re: quote removal issues within character class

FromRobert Elz <kre@munnari.OZ.AU>
Date2019-11-09 06:52 +0700
SubjectRe: quote removal issues within character class
Message-ID<mailman.1053.1573257332.13325.bug-bash@gnu.org>
    Date:        Sat, 9 Nov 2019 00:50:52 +0300
    From:        =?UTF-8?B?T8SfdXo=?= <oguzismailuysal@gmail.com>
    Message-ID:  <CAH7i3LrZFvJ1ELJzTdQzF1tTqhi9FDrA7xWWYWrd4RgWJs0Wtg@mail.gmail.com>

These two

  | v=foo
  | echo ${v#[[:"lower":]]}

  | case foo in (*[![:"lower":]]*) echo bar; esac

are because bash believes that the character class name must not
be quoted (which is likely to be clarified to be incorrect in the
next revision of posix).

This one

  | case foo in (*[![":lower":]]*) echo bar; esac

is correct, as "foo" does not contain a ']' which would be required
to match there (quoting the ':' means there is no character class,
hence we have instead (the negation of) a char class containing '[' ':'
'l' 'o' 'w' 'e' ';r' (and ':' again), preceded by anything, and
followed by ']' and anything.   foo does not match. f]oo would.

kre

[toc] | [standalone]


Back to top | Article view | gnu.bash.bug


csiph-web