getting rid of ^M

Florin Iamandi florin.i at tiscali.it
Fri Sep 1 01:42:55 PDT 2006


Craig Hammond dixit (2006-09-01, 10:20:04):

> After FTPing a heap of files from Windows to OBSD, I have found that a
> lot of the text them have a ^M at the end of each line. Is there any
> easy way to recursively strip out the ^M of all affected files in a
> number of directories.

Use something like this, where ^M is obtained by pressing CTRL-V
followed by CTRL-M:

for i in `ls`; do sed 's/^M//g' $i > $i.new;done

-- 
Digitally yours,
Florin Iamandi (Slippery)
Reason is the first victim of emotion. -- Scytale, Dune Messiah

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mailman.theapt.org/pipermail/openbsd-newbies/attachments/20060901/391c0811/attachment.bin


More information about the Openbsd-newbies mailing list