tr

Cathy Benney cathy at ncelvax.UUCP
Thu Nov 16 16:28:56 AEST 1989


Hello.  I have been experimenting with "tr", the translate characters command.  I am curious to know if tr can substitute from a single character in string 1 
to multiple characters in string 2.  For example, could "tr" substitute
'\012' (the ascii new line) for '\015\012' (which would be ^M^J).  I have been 
trying this, using a command like: 
    tr '\012' '\015\012' < file.1 > file.2 
but without any luck.  In the command above, tr substitutes ascii 012 for 
ascii 015.  What I would like is for tr to substitute every 012 with an
012 015.  I am a novice in using tr (could you guess?), so my approach may be 
off, but I would appreciate any suggestions you may have. Thank you. 



More information about the Comp.unix.questions mailing list