Tr (Unix)
From Free net encyclopedia
(Difference between revisions)
Revision as of 18:54, 20 April 2006
Unixguy (Talk | contribs)
add see also [[List of Unix programs]]
Next diff →
Unixguy (Talk | contribs)
add see also [[List of Unix programs]]
Next diff →
Current 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]