Re: tr problem



Patrick O'Callaghan wrote:

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

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.
More like:

cat input-filename | tr '\r' '\n' >output-filename

Not so? tr is a filter.
It reads stdin and writes stdout, like most unix command line programs. The shell will connect those to whatever you want with |'s or <>'s. Using cat with a pipe is a waste of a process, though. tr can read it's own input just as well with <input-filename.

Quite true, but I remember a remark in one of the classic Unix papers to
the effect that people somehow found the 'cat foo | ' syntax more
natural.

I suppose you get used to using cat when there are multiple input files that you want to combine.

--
Les Mikesell
lesmikesell@xxxxxxxxx

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



Relevant Pages

  • Re: Another comment on how much Europeans love America
    ... Cat is Jewish. ... That explains the gefiltefish thing........ ... There will be a similar legacy of the US, and it's President, George W. ...
    (rec.motorcycles)
  • Re: Eliminate Variable
    ... >> oops i am sorry i forgot to add the cosine factor in ... >> Now I want to get a single equetion with variable X1 only.I want to ... The best material model of a cat is another, or preferably the same, cat. ...
    (comp.soft-sys.matlab)
  • Re: [PATCH 00/10] Containers(V10): Generic Process Containers
    ... When I then used cat, the file was empty, and I got an oops just ... As far as I could see, Pavel's problem wasn't actually an Oops, it was ... a WARN_ONwhen allocating a zero length chunk of memory. ... zero-length chunk. ...
    (Linux-Kernel)
  • Re: OT: Jam doughnuts
    ... cat wrote: ... I really must bike there. ... Oops! ...
    (uk.rec.motorcycles)
  • Re: Live Like a Cat Day
    ... Even if it makes me want to go "Arrrrr!" ... Oops, wrong ... holiday. ... Actually, around here, every day is Live Like a Cat Day. ...
    (rec.pets.cats.anecdotes)