Re: automatically deleting ^M on text files
Yannick Jestin <jestin@cena.fr> writes:
> > t s a d i <ch4di@yahoo.com> writes:
> [...]
> > > has the character "^M" all over it (caused when someone uploads a
> text
>
> Olaf's solution is a bit complex, I'd say. It involves a 'rm', and
> it can be dangerous !
Would you care to enlighten me and the rest of the list? The original
file is only removed if `tr' succeeded.
For reference, I suggested:
for file in *; do
mv $file $file.old
tr '\015' '\012' < $file.old > $file && rm $file.old
done
> The sysutils package, at least in slink and potato, has the dos2unix
> program.
>
> $ dos2unix *
--
Olaf Meeuwissen Epson Kowa Corporation, Research and Development
Reply to: