[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Stupid Question: Striping Dos ^M From Texts



Here's a sed script that I've used for years on my old SCO Unix box.  I'm
not actually positive it works on Linux because I haven't tried it, but sed
is sed, right?...

It adds ^M's if they're missing and deletes them if found.  (i.e. one
script that will do both conversions)

sed -e '
s-^M--g
t
s+$+^M+
t
' < infile > outfile

One caveat -- infile and outfile **can't** be the same.

Later,

Kevin Traas
Systems Analyst
Edmondson Roper CA
http://www.eroper.bc.ca


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-user-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .


Reply to: