Hi my script goes like this.
gzcat Jan06.gz | awk 'BEGIN { FS = "|" } ; $2 ~ /^[A-Z]{3}$/ { print $2 }' > cnt
sort -n cnt | uniq -c | sort -n > cnt1
cat cnt1 | awk 'BEGIN{OFS="|"} {print $1,$2}' > rep
here i am hard coded Jan06.gz .
but it is inside the dir /gns/gnsadm/notify/bpdcc/work/
every day new file will be generated (ex Jan07,jan08)
how to do in generic manner?