home *** CD-ROM | disk | FTP | other *** search
/ minnie.tuhs.org / unixen.tar / unixen / PDP-11 / Trees / V6 / usr / man / man1 / tr.1 < prev    next >
Encoding:
Text File  |  1975-06-26  |  1.9 KB  |  84 lines

  1. .th TR I 5/20/74
  2. .sh NAME
  3. tr \*- transliterate
  4. .sh SYNOPSIS
  5. .bd tr
  6. [
  7. .bd \*-cds
  8. ] [ string1 [ string2 ] ]
  9. .sh DESCRIPTION
  10. .it Tr
  11. copies the standard input to the standard output with 
  12. substitution or deletion of selected characters.
  13. Input characters found in 
  14. .it string1
  15. are mapped into the corresponding characters of
  16. .it string2.
  17. Any combination of the options
  18. .bd \*-cds
  19. may be used.
  20. .bd \*-c
  21. complements the set of characters in
  22. .it string1
  23. with respect to the universe of characters
  24. whose ascii codes are 001 through 377 octal.
  25. .bd \*-d
  26. deletes all input characters in
  27. .it string1.
  28. .bd \*-s
  29. squeezes all strings of repeated output characters that are
  30. in 
  31. .it string2
  32. to single characters.
  33. .s3
  34. The following abbreviation conventions may be used
  35. to introduce ranges of characters or repeated characters into
  36. the strings:
  37. .s3
  38. \fB[\fIa\*|\fB\*-\fIb\fB\*|]\fR
  39. stands for the string of characters whose ascii codes run
  40. from character
  41. .it a
  42. to character
  43. .it b.
  44. .s3
  45. \fB[\fIa\fB\*|*\fIn\fB\*|]\fR,
  46. where
  47. .it n
  48. is an integer or empty, stands for \fIn\fR-fold 
  49. repetition of character
  50. .it a.
  51. .it n
  52. is taken to be octal or decimal according as its
  53. first digit is or is not zero.
  54. A zero or missing
  55. .it n
  56. is taken to be huge;
  57. this facility is useful for padding
  58. .it string2.
  59. .s3
  60. The escape character `\\' may be used as in
  61. .it sh
  62. to remove special meaning from any character in a string.
  63. In addition,
  64. `\\' followed by 1, 2 or 3 octal digits stands for the
  65. character whose ascii code is given by those digits.
  66. .s3
  67. The following example creates a list of all
  68. the words in `file1' one per line in `file2',
  69. where a word is taken to be a maximal string of alphabetics.
  70. The strings are quoted
  71. to protect the special characters from interpretation by the Shell;
  72. 012 is the ascii code for newline.
  73. .s3
  74. .ti +8
  75. tr \*-cs "[A\*-Z][a\*-z]" "[\\012*]" <file1 >file2
  76. .sh "SEE ALSO"
  77. sh (I), ed (I), ascii (V)
  78. .sh BUGS
  79. Won't handle ascii NUL in
  80. .it string1
  81. or
  82. .it string2;
  83. always deletes NUL from input.
  84.