The script is in the answer:
http://stackoverflow.com/questions/24192459/bash-running-out-of-file-descriptors
It has 3 global variables, finishing in _CP, _TB and _CO.
It runs out of file descriptors after 1 or 2 hours.
I do not know much about Linux but I hope it helps you.
GNU bash, version 4.2.37(1)-release (i486-pc-linux-gnu)
--
Atte.: Jorge Sivil