

TR (1)                      07/06/78                       TR (1)


NAME
       tr - character transliteration

SYNOPSIS
       tr <infile >outfile from [to]

DESCRIPTION
       "TR"  copies  the  standard  input  to the standard output
       with substitution  or  deletion  of  selected  characters.
       Input  characters  found  in  "FROM"  are  mapped into the
       corresponding characters of "TO".   Ranges  of  characters
       may  be  specified  by  separating the extremes by a dash.
       For example, a-z  stands  for  the  string  of  characters
       whose  ascii  codes run from character a through character
       z. 
       
       If the number of characters in "FROM" is the  same  as  in
       "TO",  a  one  to  one  corresponding  translation will be
       performed  on  all  occurrences  of  the   characters   in
       "FROM".   If  the  number  of characters in "FROM" is more
       than in "TO", the implication is that the  last  character
       in  the  "TO"  string  is  to  be  replicated  as often as
       necessary to make a string as long as the  "FROM"  string,
       and  that  this  replicated  character should be collapsed
       into only one.  If the "TO" string is  missing  or  empty,
       "TR"  will  take this condition as a request to delete all
       occurrences of characters in the "FROM" string. 

       "TR" differs from the tool "CH" since it deals  only  with
       single  characters  or  ranges  of  characters, while "CH"
       deals with character  strings.   For  example   tr  xy  yx
       would  change  all  x's  into  y's  and  all y's into x's,
       whereas ch xy yx change all the patterns "xy" into "yx". 

       One of the most common functions of "TR" is  to  translate
       upper case letters to lower case, and vice versa.  Thus,
       
                               tr A-Z a-z
       
       would  map all upper case letters to lower case.  Users of
       systems which  cannot  pass  both  upper  and  lower  case
       characters  on  a  command line should remember to include
       the appropriate escape flags. 

FILES
       None

SEE ALSO
       find, ch, edit, sedit
       The "Software Tools" book, p. 51-61.
       The "UNIX Programmer's Manual", p. TR(I).

DIAGNOSTICS
       "usage: translit from to."
            The command line passed to transit is in error. 
       "from: too large."


                               -1-




TR (1)                      07/06/78                       TR (1)


            The string for "from" is too  large.   Current  limit
            is 100 characters including E0S. 
       "to: too large."
            The  string  for "to" is too large.  Current limit is
            100 characters including EOS. 

AUTHORS
       Original  code  from  Kernighan  and  Plauger's  "Software
       Tools", with minor modifications by Debbie Scherrer. 

BUGS/DEFICIENCIES















































                               -2-


