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

Re: base: Fails when i process a simple shell script with regular expressions in Lenny but not in Etch.



Hi,

On Thu, Nov 26, 2009 at 5:22 PM, Ricardo F <rikr@esdebian.org> wrote:
> Package: base
> Severity: normal
>
> *** Please type your report below this line ***
>
> Whe i put this script in etch, it works, but in lenny don't work, the
> condition is true, but any lines are output. ¿i don't know what's the
> problem?
>
>
>
> if [[ foobarbletch =~ 'foo(bar)bl(.*)' ]]
>  then
>
>          echo The regex matches!
>          echo $BASH_REMATCH      -- outputs: foobarbletch
>
>          echo ${BASH_REMATCH[1]} -- outputs: bar
>          echo ${BASH_REMATCH[2]} -- outputs: etch
>
>  fi
You should activate compat31 option ...

shopt -s compat31

quoting bash manual:
             compat31
                      If set, bash changes its behavior to that of
version 3.1 with respect to quoted arguments to the conditional  com‐
                      mand's =~ operator.


Regards,


Reply to: