bug-bash
[Top][All Lists]
Advanced

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

Re: regexp matching broken in bash-3.2.x?


From: Bernd Eggink
Subject: Re: regexp matching broken in bash-3.2.x?
Date: Sat, 27 Oct 2007 20:05:34 +0200
User-agent: Thunderbird 2.0.0.6 (X11/20070728)

Pierre Gaston schrieb:
On 10/27/07, Bernd Eggink <monoped@sudrala.de> wrote:
Pavel Gorshkov schrieb:

Description:
    Regexp matching seems to be broken since 3.2.0.
Repeat-By:
    The following used to work in bash-3.1:
      $ [[ test =~ 't.*t' ]]; echo $?
      1
It works without the quotes. Looks like they are taken literally instead of
being removed. I, too, f.think it's a bug, as according to  the docs, quote
removal should be performed on the words between [[ and ]].

The behavior changed with 3.2, from the NEWS file:

" Quoting the string argument to the [[ command's  =~ operator now forces
  string matching, as with the other pattern-matching operators."

Quoting removal is performed but [[ is not a normal command (it's a
shell keyword)

OK. While I don't consider this a good idea, at least the reference manual should be updated, which presently says:

"Word splitting and filename expansion are not performed on the words between the `[[' and `]]'; tilde expansion, parameter and variable expansion, arithmetic expansion, command substitution, process substitution, _and quote removal_ are performed."

Regards,
Bernd


--
Bernd Eggink
monoped@sudrala.de
http://sudrala.de




reply via email to

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