Re: Bug in bash regex: doesn't recognise the line start caret

2011-11-04 Thread DJ Mills
On Fri, Nov 4, 2011 at 4:31 AM, Graham North wrote: > Hi, > > There seems to be a bug in bash regex. > > It doesn't recognise the line start caret: > > --Commands: > ONE="/fred" > TWO="fred/" > REGEX='^/' > echo "$ONE $TWO $REGEX" > [[ "$ONE" =~ "$REGEX" ]] && echo yes || echo no > [[ "$TWO" =~ "$

Bug in bash regex: doesn't recognise the line start caret

2011-11-04 Thread Graham North
Hi, There seems to be a bug in bash regex. It doesn't recognise the line start caret: --Commands: ONE="/fred" TWO="fred/" REGEX='^/' echo "$ONE $TWO $REGEX" [[ "$ONE" =~ "$REGEX" ]] && echo yes || echo no [[ "$TWO" =~ "$REGEX" ]] && echo yes || echo no --Result: /fred fred/ ^/ no no Not sure