How can I list normal text (.txt) filenames, that don\'t end with a newline?
e.g.: list (output) this filename:
$ cat a.txt
asdfasdlsad4rand
This is kludgy; someone surely can do better:
for f in `find . -name '*.txt' -type f`; do
if test `tail -c 1 "$f" | od -c | head -n 1 | tail -c 3` != \\n; then
echo $f;
fi
done
N.B. this answers the question in the title, which is different from the question in the body (which is looking for files that end with \n\n I think).