Use ascii mode when ftp-ing the files and it'll do the conversion for
you.
Otherwise, use vi, sed or ex to change the files.
In vi
:%s,^M$,,
In sed
sed 's,^M$,,' filename > newfilename
In ex you can change the files automatically without resorting to
having to create new files.
#!/bin/sh
for file in * ; do
ex -s $file <<-_HERE_
1,$s,^M$,,
w
q
_HERE_
done
^M is literally <ctrl>V <ctrl>M. The $ anchors the pattern match to
the end of the line.
Cheers,
Mario
> i have some files that were written with notepad or wordpad and when the
> file is transferred to an unix system and i use vi to read it, there is
> a ^M at the end of the line.
> basically, i need to delete the ^M character. does anyone know how i
> can do this with going in and changing all the files manually?
> i assume that ^M is a character representation of a carriage return,
> right?
> thanks for any help