Not sure I fully understand what you're doing and what you're after, but a few comments:
Why do you use (convert to) date formats like
Mon Oct 27 18:00:01 CET 2014 when the date/time part of your file names is
YYYY-MM-DD_HH.mm.ss, i.e. totally different?
info date:
Quote:
The output of the ‘date’ command is not always acceptable as a date string, not only because of the language problem, but also because there is no standard meaning for time zone items like ‘IST’. When using ‘date’ to generate a date string intended to be parsed later, specify a date format that is independent of language and that does not use time zone items other than ‘UTC’ and ‘Z’.
Why do you convert "_" chars to " " and "." to ":" if you dont use those afterwards?
Why do you specify the time stamps down to the second but iterate the loop in one minute steps only?
Would it be feasible to do all the looping, calculating etc. on seconds since epoque, and then convert those to a time string for the comparison /
grepping? Would it make sense to forgo the seconds when
grepping?
And, in lieu of the
sed invocation in
inputDateFmt, did you consider
bash's "Parameter Expansion: Pattern substitution"?