I am not certain about this but I *think* this might be a bug in shuf.

full description of how to reproduce is here
http://stackoverflow.com/questions/40730239/shuf-generates-bad-file-descriptor-error-on-nfs-but-only-when-run-as-a-backgro


--