Scott Carpenter <[EMAIL PROTECTED]> wrote:
> V="one/two"
> [[ ! $V =~ ^\.*/ ]] && echo not

3.1 will remove the backslash as part of basic string parsing, just as
if this were not part of a [[ command, while 3.2 handles the arguments
for [[ specially, and will keep the backslash as part of the regexp.
This will work in both versions:
pattern='^\.*/'
[[ ! $V =~ $pattern ]] && echo not


paul


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

Reply via email to