_tr(1) - [FUNIX:M_strings] translate or delete characters (LICENSE:PD)
Synopsis
Description
Options
Examples
Author
License
_tr [ -o SET1 [ -n SET2 ]]|-l| -u |[ --version ]|[ --help ]
Translate, squeeze, and/or delete characters from standard input, writing to standard output.
-o SET1,-n SET2 old set of characters and new set of characters to replace the old set.
o Each character in the input string that matches a character in the old set is replaced. o If the new set is the empty set the matched characters are deleted. o If the new set is shorter than the old set the last character in the new set is used to replace the remaining characters in the new set. -u convert to uppercase -l convert to lowercase --help display this help and exit --version output version information and exit
Sample usage
#convert input to uppercase: _tr -u _tr -o abcdefghijklmnopqrstuvwxyz -n ABCDEFGHIJKLMNOPQRSTUVWXYZ# out of !"#$%&()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_abcdefghijklmnopqrstuvwxyz{|}~ # just leave letters _ tr -o !"#$%&""()*+,-./0123456789:;<=>?@[\]^_{|}~
John S. Urban
Public Domain
_tr (1) | March 11, 2021 |