( r0pi | 2011. 11. 04., p – 17:50 )


[redhat 4.4 ~]$ if [[ 111.1.1 =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then echo jo ; else echo rossz ; fi
jo
[redhat 4.4 ~]$bash --version
GNU bash, version 3.00.15(1)-release (x86_64-redhat-linux-gnu)
Copyright (C) 2004 Free Software Foundation, Inc.

[redhat 5.3 ~]$ if [[ 111.1.1 =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then echo jo ; else echo rossz ; fi
jo
[redhat 5.3 ~]$bash --version
GNU bash, version 3.2.25(1)-release (x86_64-redhat-linux-gnu)
Copyright (C) 2005 Free Software Foundation, Inc.

[redhat 5.7 ~]$if [[ 111.1.1 =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then echo jo ; else echo rossz ; fi
jo
[redhat 5.7 ~]$bash --version
GNU bash, version 3.2.25(1)-release (x86_64-redhat-linux-gnu)
Copyright (C) 2005 Free Software Foundation, Inc.

[centos 5.5 ~]$ if [[ 111.1.1 =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then echo jo ; else echo rossz ; fi
jo
[centos 5.5 ~]$ bash --version
GNU bash, version 3.2.25(1)-release (x86_64-redhat-linux-gnu)
Copyright (C) 2005 Free Software Foundation, Inc.