[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
problem with extended regular expression in bash 4.1
From: |
Alex Chupin (achupin) |
Subject: |
problem with extended regular expression in bash 4.1 |
Date: |
Sat, 24 Nov 2012 21:08:16 +0000 |
Dear All,
Can someone shed light on the difference in behaviour of bash 4.1. and 3.25? I
am out of ideas.
Regards,
Alexander Chupin
$ bash --version; s=12345;if [[ "$s" =~ '^[0-9]+$' ]]; then echo it is a
number; else echo it is NOT a number; fi
GNU bash, version 4.1.2(1)-release (x86_64-redhat-linux-gnu)
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
it is NOT a number
$ bash --version; s=12345;if [[ "$s" =~ '^[0-9]+$' ]]; then echo it is a
number; else echo it is NOT a number; fi
GNU bash, version 3.2.25(1)-release (x86_64-redhat-linux-gnu)
Copyright (C) 2005 Free Software Foundation, Inc.
it is a number
- problem with extended regular expression in bash 4.1,
Alex Chupin (achupin) <=