[rhelv6-beta-list] =~ no longer working in bash

John Haxby jch at thehaxbys.co.uk
Tue Jun 8 13:39:12 UTC 2010


On 8 June 2010 13:46, Dennis Marinus <dennis at marinus.nu> wrote:

>
> On 8 jun 2010, at 14:32, Farkas Levente wrote:
> > On 06/08/2010 02:23 PM, Dennis Marinus wrote:
> >> On 8 jun 2010, at 14:02, Farkas Levente wrote:
> >> Please try
> >> if [[ "abc" =~ abc.* ]]; then echo inside; else echo outside; fi
> >
> > it says: "Quoting not necessary, as of version 3.2 of Bash", but not
> > said it's a bug. and still use "" in the second and all other examples.
>
> I agree, the manual contradicts itself. It says both "As of version 3.2 of
> Bash, expression to match no longer quoted" (meaning: don't quote) and
> "Quoting not necessary, as of version 3.2 of Bash" (meaning: you don't have
> to but you can). The difference in behavior is the treatment of special
> chars.
>
> In my opinion it's not a bug. Bash is working as designed, but the design
> has changed between RHEL5 & RHEL6.
>
> According to http://tiswww.case.edu/php/chet/bash/FAQ:
> E14) Why does quoting the pattern argument to the regular expression
> matching
>     conditional operator (=~) cause regexp matching to stop working?
> [snip]
>


The manual page on F13 (and I think on RHEL6) says

"Any part of the pattern may be quoted to force  it  to  be  matched  as  a
string."

So yes, it's changed, but it's not a bug.

jch
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/rhelv6-beta-list/attachments/20100608/e2814c65/attachment.htm>


More information about the rhelv6-beta-list mailing list