-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

The Ultimate Linux Shell Scripting Guide
By :

You can use tr
for a variety of translation chores. (After all, tr
does stand for translate.) Rather than translating from one language to another, tr
translates from one character to another, from a range of characters to another, or from one class of characters to another. You can also delete selected characters from a file or eliminate duplicate characters.
Compared to the utilities that we’ve looked at so far, there’s a big difference with how tr
operates. The other utilities that we’ve looked at so far can get their input from arguments that you would supply on the command-line. So, you don’t need to use the stdin
redirector with them. The tr
utility can’t use arguments, so you’ll either have to use a stdin
redirector or pipe its input in from another command.
For the first example, create the file translation.txt
, and use tr
to change every occurrence of a single character. Make the file look like this:
[donnie@fedora...