My target is to verify if $FILE is a backup file ( backup file ended with xxxx.xx.xx.xx number
Example of backup files
ls /etc/VRTSvcs/conf/config
main.cf.17Dec2012.09.10.14
main.cf.17Dec2012.09.10.23
main.cf.17Dec2012.09.10.31
Example of not backup file
main.cf
I write the following ksh script line in order to verify if $FILE ended with xxxx.xx.xx.xx number
.
[[ ` echo $FILE | grep -v '[0-9]\{4\}\.[0-9]\{2\}\.[0-9]\{2\}\.[0-9]\{2\}' ` -eq 0 ]] && echo Not Backup file
I set the
FILE="main.cf.17Dec2012.09.10.31"
and I run this line on Solaris/Linux , but I get "Not Backup file" , in spite $FILE ended with 2012.09.10.31
please advice what the problem with my ksh line ( what need to fix ) in order to match the numbers - xxxx.xx.xx.xx