Gack, please don't post the same question multiple times. I already replied once.
deleting specific lines from all files in a directory
The second line in Jim's script (and mine, too) moves the tmp file back over the original file. You can't easily redirect back onto a file because the redirection happens before awk gets to read it, so the file ends up being empty. There are various ways to avoid using temporary files but in this particular case it's probably not worth the hassle.
The
ls in backticks is an antipattern; see
An example of dealing with file names with spaces in them for a discussion of the drawbacks. Simply use "for file in *.txtdatafile" instead.