2007/2/21, Ag. Hatzimanikas <[EMAIL PROTECTED]>:

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) ]]
        then
        sed 's/^M$//' $filename > $filename.unix
        fi
done
===========================================


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!

Cheers, Warren
-- 
http://linuxfromscratch.org/mailman/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to