Also known as tr.1, tr(1), /usr/bin/tr
command in Unix-like operating systems
The tr utility shall copy the standard input to the standard output with substitution or deletion of selected characters. The options specified and the string1 and string2 operands shall control translations that occur while copying characters and single-character collating elements. Complement the set of values specified by string1 . See the EXTENDED DESCRIPTION section. Complement the set of characters specified by string1 . See the EXTENDED DESCRIPTION section. Delete all occurrences of input characters that are specified by string1 . Replace instances of repeated characters with a single character, as described in the EXTENDED DESCRIPTION section. Translation control strings. Each string shall represent a set of characters to be converted into an array of characters used for the translation. For a detailed description of how the strings are interpreted, see the EXTENDED DESCRIPTION section. Provide a default value for the internationalization variables that are unset or null. (See XBD Internationalization Variables for the precedence of internationalization variables used to determine the values of locale categories.) If set to a non-empty string value, override the values of all the other internationalization variables. Determine the locale for the behavior of range expressions and equivalence classes. Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error. [XSI) ] ![[Option Start]]( Determine the location of message catalogs for the processing of LC MESSAGES. ![[Option End]]( The tr output shall be identical to the input, with the exception of the specified transformations. The operands string1 and string2 (if specified) define two arrays of characters. The constructs in the following list can be used to specify characters or single-character collating elements. If any of the constructs result in multi-character collating elements, tr shall exclude, without a diagnostic, those multi-character elements from the resulting array. Any character not described by one of the conventions below shall represent itself. Octal sequences can be used to represent characters with specific coded values. An octal sequence shall consist of a followed by the longest sequence of one, two, or three-octal-digit characters (01234567). The sequence shall cause the value whose encoding is represented by the one, two, or three-digit octal integer to be placed into the array. Multi-byte characters require multiple, concatenated escape sequences of this type, including the leading for each byte. If either or both of the range endpoints are octal sequences of the form octal , this shall represent the range of specific coded values between the two range endpoints, inclusive. Represents all characters belonging to the defined character class, as defined by the current setting of the LC CTYPE locale category. The following character class names shall be accepted when specified in string1 : If the name specified for class does not define a valid character class in the current locale, the behavior is undefined. Input characters found in the array specified by string1 shall be deleted. The same string cannot be used for both the -d and the -s option; when both options are specified, both string1 (used for deletion) and string2 (used for squeezing) shall be required. When the -s option is specified, after any deletions or translations have taken place, repeated sequences of the same character shall be replaced by one occurrence of the same character, if the character is found in the array specified by the last operand. If the last operand contains a character class, such as the following example: the last operand's array shall contain all of the characters in that character class. However, in a case conversion, as described previously, such as: the last operand's array shall contain only those characters defined as the second characters in each of the toupper or tolo
Excerpt from a page describing this subject · 20,993 chars · not written by Vinony
via Wikidata · CC0
via Wikidata sitelinks · CC0
Discovered by embedding cosine similarity (sentence-transformers MiniLM, 384-dim).