Ok, here is a smaller 3 line test case.  I have attempted to handle
the parenthesis as you instructed.  Under bash 3.0.17 BASH_REMATCH
gets the 4 pieces.  Under bash 3.2 I only get BASH_REMATCH=()
True, it no longer crashes.  But it doesn't work either...

#!/bin/bash
[[ jbig2dec-0.9-i586-001.tgz =~ 
\([^-]+\)-\([^-]+\)-\([^-]+\)-0*\([1-9][0-9]*\)\.tgz ]]
set | grep BASH_REMATCH

On Thu, 12 Oct 2006, Andreas Schwab wrote:

John Gatewood Ham <[EMAIL PROTECTED]> writes:

Thank you for your reply.

I removed the quotes and the script crashes.  There must be more
required to convert my code and I hope someone will help.  It is
only 1 line, and once I know the new rules I can convert everything
else on my own.  I get this when just removing the quotes on the
right hand side:

testcase running under 3.2.0(2)-release
testcase: line 6: unexpected argument `(' to conditional binary operator
testcase: line 6: syntax error near `(['
testcase: line 6: `[[ "${OLDCANDIDATE}" =~ 
([^-]+)-([^-]+)-([^-]+)-0*([1-9][0-9]*)\.tgz ]]'

Parens are special inside [[ ]], you need to quote them.

Andreas.


_______________________________________________
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash

Reply via email to