On Fri, 19 Jan 2007 00:56:03 -0600 (CST)
[EMAIL PROTECTED] wrote:

>       # run this, eh?
>       DOG="Dog name - 01 - Wiggles"
>       if [[ $DOG =~ "([[:alpha:][:blank:]]*)- ([[:digit:]]*) -
> (.*)$" ]] then
>          echo Dog ${BASH_REMATCH[2]} is ${BASH_REMATCH[3]}
>       fi

You can actually get it to work in bash 3.2, by writing:

if [[ $DOG =~ ([[:alpha:][:blank:]]*)-\ ([[:digit:]]*)\ -\ (.*)$ ]]
then
  echo Unquoted Dog ${BASH_REMATCH[2]} is ${BASH_REMATCH[3]}
fi

however this fails in 3.1 - it'll work in 3.1 if you also escape the
brackets, but that then fails in 3.2.  Which means the only way to
guarantee it is to write both, and check the bash version :/


Chet,
any comment on this issue? (see also my earlier mail from Sunday 14th,
http://lists.gnu.org/archive/html/bug-bash/2007-01/msg00035.html, and
Tim's bug at
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=220087)
At least to confirm/deny that it may be a real problem?


Thanks,
-- 
Kevin F. Quinn

Attachment: signature.asc
Description: PGP signature

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

Reply via email to