Bash has, if I recall correctly, no built-in limit on array size. KornShell93 supports indexes up to about 64k in recent releases (and up to 4095 in older releases).
There is a utility called mtree which is used to compare a file hierarchy with a specification. Any deviation from the specification (missing files or directories, or ownership/permission discrepancies) are reported and optionally corrected (if possible).
Since I don't know what Unix you're on, I can't further point you to where to find this utility. It's in OpenBSD's base system, but is evidently also available for Linux.