in reply to Re^2: Scanning a directory's files for readability
in thread Scanning a directory's files for readability

readdir returns dat.txt, because it finds CSV/dat.txt. -f, on the other hand, runs on dat.txt only, i.e. ./dat.txt. ! -d is true for files that exists in CSV, but do not exist in the current directory.
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Replies are listed 'Best First'.
Re^4: Scanning a directory's files for readability
by Cristoforo (Curate) on Jan 20, 2014 at 02:26 UTC
    Thanks! grep with -f was finding files in the current directory (that were also in the CSV subdirectory). The correction would be to prepend the subdir to the filename to test with -f.

    grep -f qq[CSV/$_]