I am trying to report on the number of files created on each date. I can do that with this little one liner:
ls -la foo*.bar|awk \'{print $7, $6}\'|sort|uni
Just use the field number of your month as an index into the months
array.
print months[$6]
Since ls
output differs from system to system and sometimes on the same system depending on file age and you didn't give any examples, I have no way of knowing how to guide you further.
Oh, and don't parse ls.