Tr (Unix)
From Free net encyclopedia
Revision as of 18:54, 20 April 2006; view current revision
←Older revision | Newer revision→
←Older revision | Newer revision→
tr (abbreviated from translate or transliterate) is a command in Unix-like operating systems.
When executed, the program reads from the standard input and writes to the standard output. It takes as parameters two sets of characters, and replaces occurrences of the characters in the first set with the corresponding elements from the other set. The following inputs, for instance, (equivalent to tr abcdefghijklmnopqrstuvwxyz zabcdefghijklmnopqrstuvwxy) shift the input letters of the alphabet back by one character.
$ echo "ibm 9000" > computer.txt $ tr [a-z] [za-y] < computer.txt hal 9000
tr is an operator in Perl as well, which operates analogously.
[edit]
See also
[edit]