bug-bash
[Top][All Lists]
Advanced

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

Re: =~ no longer working in bash-4.1


From: Greg Wooledge
Subject: Re: =~ no longer working in bash-4.1
Date: Tue, 8 Jun 2010 10:16:28 -0400
User-agent: Mutt/1.4.2.3i

On Tue, Jun 08, 2010 at 02:23:48PM +0200, Farkas Levente wrote:
> -----------------------------
> if [[ "abc" =~ "abc.*" ]]; then echo inside; else echo outside; fi
> -----------------------------
> this give "inside" up to 4.0, but it gives "outside" in 4.1.

If you want the .* to be taken as a regular expression, rather than a literal
period and asterisk, you must remove the quotes from around it.

  if [[ abc =~ abc.* ]]; then echo match; else echo no match; fi



reply via email to

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