Re: tr problem



Les Mikesell wrote:
Gene Heskett wrote:

I'm trying to convert a test file, src code for a legacy computer, whose eol is a single cr into one with a newline subbed for each cr, and tr is being a pita, it broken, or there is PEBKAC.

If I use this syntax:

tr -c \r \n <filename >filename2

Then the whole file is converted to nnnnnnnnnn's, every byte.

The manpage (and pinfo tr too) is, shall we say, completely lacking in how to handle the file I/O.

So how do you use tr?"

Or is there a better tool for this than tr?


The tr syntax would be
tr -d '\r'
but for one or a few files you can just load in vi (vim) and
:set fileformat=unix
and write it back out.

Plus, you probably have a program called dos2unix installed...

Oops, I should have read past the word 'legacy' which must not have meant what I thought.
tr '\r' '\n'
should work.

--
Les Mikesell
lesmikesell@xxxxxxxxx

--
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list



Relevant Pages

  • Re: tr problem
    ... Les Mikesell wrote: ... whose eol is a single cr into one with a newline subbed for each cr, and tr is being a pita, it broken, or there is PEBKAC. ... but for one or a few files you can just load in vi (vim) and ...
    (Fedora)
  • Re: tr problem
    ... Les Mikesell wrote: ... eol is a single cr into one with a newline subbed for each cr, ... The tr syntax would be ... And that might be something that is not in the vim manpages Mike, ...
    (Fedora)
  • Re: vi editor
    ... Les Mikesell wrote: ... I hadn't noticed that before and just tried it on FC4 (vim 6.3) ... and FC5 and neither seemed to have any problem without a ...
    (Fedora)
  • Re: vi editor
    ... I hadn't noticed that before and just tried it on FC4 (vim 6.3) ... and FC5 and neither seemed to have any problem without a ... Les Mikesell ...
    (Fedora)