"C" stuff will be much faster than scripts, so sometimes even a "dumb" use of a C program will be more optimal (take less time) than trying to sort out a more minimal task for the C program with bash.
Like
Code:
grep -h -m 1 THING-TO-GREP index_*
versus
Code:
< ... some bash-script logic that tries to figure out the most likely index_NNNN files
so grep has only to work with a few, not all ... >
grep
...