I have the following piece of code:
YESTER=`TZ=aaa24 date +%b"-"%d`
filelist2=$(find /export/home/gen/check/logs \( -name \*$YESTER\* ! -name \*ADM\* \) -print | tr '\n' ' ')
nawk -F':' '
$2 ~ /Reason/ && $3 !~ /(PASSTHRU|OCAP|FP Power Button|Bootloader Reset)/ {
split(FILENAME, a, "-")
f = a[1]
while (i = index(f, "/")) f = substr(f, i+1)
sub("\r$", "");
printf("%s %s,%s %s,%s,%s,%s,%s-%s-%s-%s-%s-%s-%s-%s-%s\n", a[5], a[6], a[2], a[3], a[4], f, $0, f, a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9])
}' $filelist2 >> $OUTPUT
which basically looks in a certain directory for files that contain the word 'Reason' and splits the filenames, extracting pertinent information. Everything was working smashingly until the beginning of the month, as the date format changed from:
10.7.334.245-ADM-Cisco-Jun-30-12-11-22.txt
to
10.7.334.245-ADM-Cisco-Jul--1-13-22-33.txt.
Any suggestions as to how I can modify the code to accept BOTH types of dates?