February 2001
Beginner to intermediate
448 pages
9h 2m
English
Official Description
Translates characters.
Syntax
tr [-Acs] string1 string2
Options
-A requests ASCII translation, with no extended character sets (might not be available on all UNIX variants).
-c requests the use of the complement of the chars in string1.
-s substitutes characters in string1 into string2.
Oddities
Specifying the -A option improves ASCII performance, but the option might not be available in all UNIX variants.
Example
$ cat funca # Note the {}
function funca {
print "In funca"
}
$ # Change to ( )
$ tr '{}' '()' <funca > funcanew
$
$ cat funcanew # Note the ( )
function funca (
print "In funca"
)
$
Read now
Unlock full access