sbase

suckless unix tools
git clone git://git.suckless.org/sbase
Log | Files | Refs | README | LICENSE

tr.1 (1305B)


      1 .Dd 2016-10-05
      2 .Dt TR 1
      3 .Os sbase
      4 .Sh NAME
      5 .Nm tr
      6 .Nd translate characters
      7 .Sh SYNOPSIS
      8 .Nm
      9 .Op Fl c | Fl C
     10 .Op Fl sd
     11 .Ar set1 set2
     12 .Sh DESCRIPTION
     13 .Nm
     14 matches characters from stdin and performs translations to stdout.
     15 .Sh OPTIONS
     16 .Bl -tag -width Ds
     17 .It Fl c | Fl C
     18 Match to
     19 .Ar set1
     20 complement.
     21 .It Fl d
     22 Delete characters matching
     23 .Ar set1 .
     24 .It Fl s
     25 Squeeze repeated characters matching
     26 .Ar set1
     27 or
     28 .Ar set2
     29 if
     30 .Fl d
     31 is set.
     32 .El
     33 .Sh SET
     34 .Bl -tag -width Ds
     35 .It Literal Sy c
     36 .It Escape sequence Sy \ec
     37 \e\e, \e', \e", \ea, \eb, \ee, \ef, \en, \er, \et, \ev, \exH[H], \eO[OO]
     38 .It Range Sy c-d
     39 .It Repeat Sy [c*n]
     40 Only in
     41 .Ar set2 .
     42 If n = 0 or left out, set n to length of
     43 .Ar set1 .
     44 .It Character class Sy [:class:]
     45 See
     46 .Xr wctype 3 .
     47 .It Equivalence class Sy [=c=]
     48 Resolve to
     49 .Sy c .
     50 .El
     51 .Sh TRANSLATION
     52 If
     53 .Fl d
     54 is not set,
     55 .Nm
     56 translates from
     57 .Ar set1
     58 to
     59 .Ar set2
     60 by index or character class.
     61 .Pp
     62 If
     63 .Ar set2
     64 is shorter than
     65 .Ar set1
     66 or
     67 .Ar set1
     68 is a character class,
     69 overflowing characters translate to the last character in
     70 .Ar set2 .
     71 .Sh EXIT STATUS
     72 .Bl -tag -width Ds
     73 .It 0
     74 Input processed successfully.
     75 .It 1
     76 An error occurred.
     77 .El
     78 .Sh SEE ALSO
     79 .Xr awk 1 ,
     80 .Xr sed 1 ,
     81 .Xr utf8 7
     82 .Sh STANDARDS
     83 The
     84 .Nm
     85 utility is compliant with the
     86 .St -p1003.1-2013
     87 specification except from equivalence classes.