On Mon, 2007-03-05 at 17:49 -0500, Chet Ramey wrote: > The glibc implementation of regcomp/regexec does not allow backslashes to > escape "ordinary" pattern characters when matching. Bash used backslashes > to quote all characters when the pattern argument to the [[ special > command's =~ operator was quoted. This caused the match to fail on Linux > and other systems using GNU libc.
There still doesn't seem to be a way to write expressions that work in 3.2 and in 3.1. For example, below is an expression that works fine in 3.1. How do I re-write it so that it (a) continues to work with bash-3.1, and (b) also works with bash-3.2? { cat "$file" ; echo ; } | while read line; do if [[ ! "$line" =~ '^[[:space:]]*(\#.*)?$' ]]; then /sbin/ip rule del $line fi done In particular, when the whole thing is de-quoted bash-3.1 seems to require the parentheses to be escaped, while bash-3.2 seems to require that they are *not* escaped. Tim. */
signature.asc
Description: This is a digitally signed message part
_______________________________________________ Bug-bash mailing list Bug-bash@gnu.org http://lists.gnu.org/mailman/listinfo/bug-bash