I'm not surprised that you don't see any output as you redirected that to a log file.
Wildly guessing from the scenario that you present, I infer that you want to check if the rows in several DB tables match their counterpart .csv files? You can't do that in one large lump - do it table/file pair by table/file pair.
will create the array srccnt , of which you can get at the element count with ${#srccnt�@]} .
Please provide way more details, e.g. file & table names.
EDIT: Sorry for the typo (my keyboard must have fooled me). Use ${#srccnt[@]} for the element count.
Assuming the 'select from table' example actualy reads out a table, it still compares the whole list/string with the number of lines from scrcnt.
At its best, you'd get a single "Mismatch" into your logfile.
Basic saying:
Try looping through each list element and compare it witch each table element.