Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Dec 2002 10:20:41 -0500 (EST)
From:      Jerry McAllister <jerrymc@clunix.cl.msu.edu>
To:        hawkeyd@visi.com
Cc:        wblock@wonkity.com (Warren Block), freebsd-questions@FreeBSD.ORG
Subject:   Re: tool/method to convert DOS line endings to UNIX line endings
Message-ID:  <200212041520.gB4FKgD20705@clunix.cl.msu.edu>
In-Reply-To: <20021204080104.A56240@sheol.localdomain> from "D J Hawkey Jr" at Dec 04, 2002 08:01:04 AM

next in thread | previous in thread | raw e-mail | index | archive | help
>
> ... Much deleted ...
>
> Ack. Looks like you're right, and I agree with you. If "[2addr]l" can output
> '\r', "[2addr]s/regex/repl/flags" ought to understand "\r". I have to wonder
> how many times I may have been bitten by this mis-feature.  ;-,
> 
> This'll work though:
>     sed -e 's/[[:cntrl:]]$//g'
> 
> > > I like the tr(1) conversion too, but I always seem to think in terms of
> > > sed(1) and awk(1).
> 
> And if that sed(1) solution is still "too loose", the tr(1) solution reduces
> "[[:cntrl:]]" to just the CR character.
> 

Just to be clear on this issue;  you want to be left with the LF characters
and get rid of the CR characters not the other way around.  I am not a sed
person, but your statement is backwards even if your sed works.

////jerry

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200212041520.gB4FKgD20705>