04-28-2008
3,653,
12
Join Date: Mar 2008
Last Activity: 28 March 2011, 6:41 AM EDT
Location: /there/is/only/bin/sh
Posts: 3,653
Thanks Given: 0
Thanked 12 Times in 10 Posts
The lines which don't end up in RESULT are the output from "grep ." I presume, i.e. directories which were found to already have an e* file. It would be customary to redirect the output from grep to /dev/null to avoid this, since the grep is only done for its truth value, not for printing the found directories; but of course, if you like it this way, don't change it.
You are overwriting RESULT on each iteration, so I guess it will generate an ebook for the last directory which lacks one, not the first. You can change it so it creates an empty RESULT before the loop, and then appends lines to it with >> (provided your Java thingy can cope with multiple file names in that file).