November 2015
Beginner
282 pages
5h 5m
English
Another interesting shell command is tr. This translates, squeezes, or deletes characters from the standard input. The syntax will be as follows:
tr [OPTION]... SET1 [SET2]
The options for the tr commands are explained in the following table:
|
Option |
Description |
|---|---|
|
|
Use complement of SET1 |
|
|
This deletes a range of characters specified in SET1. |
|
|
This replaces consecutive multiple occurrences of characters in SET1 with a single occurrence. |
|
|
This truncates SET1 to the length of SET2. Any extra characters in SET1 will be not considered for translation. |
SETs are a string of characters that can be specified using the following:
[:alnum:], [:digit:], [:alpha:] and so onRead now
Unlock full access