TR(1)

NAME
tr - translate character codes

SYNOPSIS
tr [-cds] [string1] [string2]

OPTIONS

EXAMPLES

DESCRIPTION

Tr performs simple character translation. When no flag is specified, each character in string1 is mapped onto the corresponding character in string2 .

There are two types of tr out there, one that requires [ and ] for character classes, and one that does not. Here is what the example above would look like for a tr that needs the brackets:

    tr ′[A-Z]′ ′[a-z]′ <x >y

Use [ and ] if you want to be portable, because a tr that doesn't need them will still accept the syntax and mindlessly translate [ into [ and ] into ].

MINIX tr supports the following character classes: alnum, alpha, digit, lower, upper and xdigit. If any of these keywords is encountered between backets and colons, it is replaced by respectively alphanumeric characters, alphabetic characters, decimal digits, lowercase letters, uppercase letters and hexadecimal digits. The following are equivalent with the given examples: