finding files in dos format + .sql files without an empty last line
warrenhead at gmail.com
Wed Feb 21 03:39:03 PST 2007
2007/2/21, Ag. Hatzimanikas <a.hatzim at gmail.com>:
> On Wed, Feb 21, at 10:14 Warren Head wrote:
> This simple loop should do the job,checked in bash/zsh.
> for filename in $(find . -type f);do
> if [[ -n $(file $filename |grep CRLF) ]]
> sed 's/^M$//' $filename > $filename.unix
This works excellent already.
I did however forget a second issue. The final line in the files I am
worried about has to be an empty line.
These are actually .sql files. The DBMS will not execute the last line, even
if it has text in it. (Regardless of whether they are
(now) written in a unix format.)
But thanks sofar anyways!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the blfs-support