Mailinglist Archive: opensuse-bugs (16652 mails)

< Previous Next >
[Bug 440861] no results from BASH_REMATCH
  • From: bugzilla_noreply@xxxxxxxxxx
  • Date: Fri, 7 Nov 2008 08:21:13 -0700 (MST)
  • Message-id: <20081107152113.0E0C7245390@xxxxxxxxxxxxxxxxxxxxxx>
https://bugzilla.novell.com/show_bug.cgi?id=440861

User werner@xxxxxxxxxx added comment
https://bugzilla.novell.com/show_bug.cgi?id=440861#c1


Dr. Werner Fink <werner@xxxxxxxxxx> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |WONTFIX




--- Comment #1 from Dr. Werner Fink <werner@xxxxxxxxxx> 2008-11-07 08:21:12
MST ---
Remove the double quotes

~> devnam=pdc_cacdecehha_part2
~> volnam=pdc_cacdecehha
~> [[ $devnam =~ ${volnam}_part([0-9]) ]]
~> echo ${BASH_REMATCH[1]}
2

as I can read from the manual page bash(1) section `Compound Commands'

When the == and != operators are used, the string to the right of the
operator
is considered a pattern and matched according to the rules described
below
under Pattern Matching. If the shell option nocasematch is enabled, the
match
is performed without regard to the case of alphabetic characters. The
return
value is 0 if the string matches (==) or does not match (!=) the pattern,
and
1 otherwise. Any part of the pattern may be quoted to force it to be
matched
as a string.

and I'll not change that as this is rthe way as upstream bash handles this.


--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

< Previous Next >
References