tr

Jonathan I. Kamens jik at athena.mit.edu
Tue Nov 21 15:03:38 AEST 1989


In article <1004 at greens.UUCP> matthew at greens.UUCP (Matthew Stier - Sun 
Visualization Products) writes:
>In article <15949 at bloom-beacon.MIT.EDU> jik at athena.mit.edu (Jonathan I.
>Kamens) writes:
>}
>}  No, the 'tr' command is not capable of changing a single character
>}in the input to multiple characters of output.
>
>True, but this particular problems can be handled by AWK also.
>
>awk '{printf ("%s\r\n", $0)}' $*

  This will work, yes.  However, the original poster asked if tr can
substitute multiple characters in the output for one character in the
input, and than gave the LF -> CR + LF case as an *example* of where
that would be necessary.

  Awk will work for that one case, but it doesn't address the general
problem.  The perl script already posted (by Randal Schwartz, I
think?) is the best solution I've yet seen to the general problem.

  Oh, well, off to learn perl.... :-)

Jonathan Kamens			              USnail:
MIT Project Athena				11 Ashford Terrace
jik at Athena.MIT.EDU				Allston, MA  02134
Office: 617-253-8495			      Home: 617-782-0710



More information about the Comp.unix.questions mailing list