Hello. Running the attached demonstration script results in the following errors, but I do not understand why:

./tmof: redirection error: cannot duplicate fd: Too many open files
./tmof: cannot make pipe for process substitution: Too many open files
./tmof: line 19: <( find "$d" -type f ): Too many open files

Removal of either the seemingly meaningless “if true” conditional or empty array declaration results in no error. Could this be a bug?

5.0.0(1)-release
#!/usr/bin/bash

dBase="$( mktemp -d )"
for (( u = 0 ; u <= "$( ulimit -n )" ; u++ )) ; do
        mkdir "$dBase/$u"
        touch "$dBase/$u/empty"
done

if true ; then

        a=()

        while read d ; do
                while read p ; do
                        echo "$p"
                done < <( find "$d" -type f )
        done < <( find "$dBase" -mindepth 1 -type d )

fi

Reply via email to