Hi Guys,
i have this files:
xyz20080716.log
opqrs20080716.log
abcdef20080716.log
xyz20080717.log
oprs20080717.log
abcde20080717.log
currentdate: 20080717.log
I want to make script to zip the file for past day. Can anyone help for this? i've just learn awk scripting & still confused with it.
Here's the script i make, but it's not working. any comment is very welcome.
#!/bin/bash
tgl1=`date +"%Y%m%d"
awk -F'.' '{tgl = substr($1,length($1)-7)
if (tgl1 ~ tgl) {print "OK"}
}' $1