tr

Jez Hancock jez.hancock at munk.nu
Fri Jun 20 16:01:03 PDT 2003


On Fri, Jun 20, 2003 at 01:44:37PM -0600, Fabio Miranda Hamburger wrote:
> How can I remove annoy "^D" end of line from MS systems?
> I know there is an utility called dos2unix.
> But I think It's possible to do it with freebsd tr.
> How would that be?
As well as the method mentioned in the replies above, you can also 
do this with 'col':

cat file | col -bx > tmp.txt && mv tmp.txt file

One annoying feature of this though is it changes tabs to spaces.

Yet another way is to do a global search/replace in vim:
:%s/
//g
(note this is ctrl-v-m, not ^(caret symbol) m!)

There are a lot of other ways too :)


More information about the freebsd-questions mailing list