tr command tutorial
1 |
|
replace
1 |
|
-c
complements the set of characters in string.i.e., operations apply to characters not in the given set
1 |
|
Output:
1 |
|
-d
delete characters in the first set from the output.
1 |
|
Output:
1 |
|
-s
replaces repeated characters listed in the set1 with single occurrence
1 |
|
Output:
1 |
|
-t
first truncates set1 to the length of set2, then do replacement
1 |
|
output
1 |
|
without -t
, character in set1
that is after set2 will repeat the last character in set1
1 |
|
tr command tutorial
https://rug.al/2019/2019-04-07-tr-command-tutorial/