unix dircmp is failing with the following error: sort: 0653-657 A write error occurred while merging
===

I'm sorry, but I'm not a super wiz in Unix. I'm trying to do a `dircmp -s dir1 dir2` on those two very large directories. After waiting a good 15min, I get the following error:

    sort: 0653-657 A write error occurred while merging.

I'm guessing it ran out of RAM while trying to execute the unix command. Do you guys have an alternative solution? 

I can also code the solution in Perl if needed :)

very appreciated thanks :)