.Dd Created:2025-10-03|Updated:2025-10-21| .de ocsi \\$* , .. .de oxr .ocsi .Xr \\$* .. .de oit .It \\$* .. .de obdi .Bl -dash -compact .oit \\$* .. .de obdl .Bd -literal -compact \\$* .. .de onote .Bl -hang -compact .oit \\$* .El .. .de ocomm .Bl -diag -compact .oit \\$* .El .. .de opsy .Pp .Sy - \\$* .. .de obc .Bl -column \\$* .. .de obc2 .obc opt desc .. .de obc3 .obc option arguments description .. .Dt TR oh .Os OpenBSD 7.7 linux| .Nm tr .Nd translate characters .Sh OPTIONS .Bl -column -offset indent ".Sy opt " .It -d Ta delete characters .It -s Ta squeeze repeats .El Characters can be specified as a character, class, range. .Bl -column -offset indent ".Sy [:character class:] " ".Sy description " .It class Ta : [:class:] Ta :alpha, alnum, digit, cntrl, upper, lower, print, space, punct. .It range Ta : aA0-zZ9 (the beginning of the range is excluded). .El .Sh EXAMPLES .Bd -literal -compact $ echo "hello" | tr "l" "m" hemmo .Ed .Ss control chacters .obdl echo \&"hello\&" | tr 'e' '\en' h llo .Ed .Ss .obdl echo 'hello' | tr 'l' '\et' he o .Ed .Ss character range .obdl echo 'hello' | tr 'h-l' 'a-d' aeddo .Ed .Ss Character classes .obdl echo '1.hello\en2.goodbye' | tr '[:digit:]' 'a-c' b.hello c.goodbye .Ed .Sh TODO .obdi check character range. .oit check octal. .oit check repetitions. .El .Sh SEE ALSO .Xr text_manipulation oh .opsy OpenBSD manpages: .Xr tr 1 .El .Sh AUTHORS .An -nosplit .Xr ohazot oh | .Xr about oh | .Lk https://ohazot.com ohazot.com .Aq Mt admin@ohazot.com