xref: /freebsd/usr.bin/tr/tr.1 (revision 4573d5012ba8d7f1347e2a238a3c2fc9e724c9fa)
19b50d902SRodney W. Grimes.\" Copyright (c) 1991, 1993
29b50d902SRodney W. Grimes.\"	The Regents of the University of California.  All rights reserved.
39b50d902SRodney W. Grimes.\"
49b50d902SRodney W. Grimes.\" This code is derived from software contributed to Berkeley by
59b50d902SRodney W. Grimes.\" the Institute of Electrical and Electronics Engineers, Inc.
69b50d902SRodney W. Grimes.\"
79b50d902SRodney W. Grimes.\" Redistribution and use in source and binary forms, with or without
89b50d902SRodney W. Grimes.\" modification, are permitted provided that the following conditions
99b50d902SRodney W. Grimes.\" are met:
109b50d902SRodney W. Grimes.\" 1. Redistributions of source code must retain the above copyright
119b50d902SRodney W. Grimes.\"    notice, this list of conditions and the following disclaimer.
129b50d902SRodney W. Grimes.\" 2. Redistributions in binary form must reproduce the above copyright
139b50d902SRodney W. Grimes.\"    notice, this list of conditions and the following disclaimer in the
149b50d902SRodney W. Grimes.\"    documentation and/or other materials provided with the distribution.
159b50d902SRodney W. Grimes.\" 4. Neither the name of the University nor the names of its contributors
169b50d902SRodney W. Grimes.\"    may be used to endorse or promote products derived from this software
179b50d902SRodney W. Grimes.\"    without specific prior written permission.
189b50d902SRodney W. Grimes.\"
199b50d902SRodney W. Grimes.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
209b50d902SRodney W. Grimes.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
219b50d902SRodney W. Grimes.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
229b50d902SRodney W. Grimes.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
239b50d902SRodney W. Grimes.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
249b50d902SRodney W. Grimes.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
259b50d902SRodney W. Grimes.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
269b50d902SRodney W. Grimes.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
279b50d902SRodney W. Grimes.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
289b50d902SRodney W. Grimes.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
299b50d902SRodney W. Grimes.\" SUCH DAMAGE.
309b50d902SRodney W. Grimes.\"
319b50d902SRodney W. Grimes.\"     @(#)tr.1	8.1 (Berkeley) 6/6/93
32c3aac50fSPeter Wemm.\" $FreeBSD$
339b50d902SRodney W. Grimes.\"
340414904dSRuslan Ermilov.Dd October 13, 2006
359b50d902SRodney W. Grimes.Dt TR 1
369b50d902SRodney W. Grimes.Os
379b50d902SRodney W. Grimes.Sh NAME
389b50d902SRodney W. Grimes.Nm tr
399b50d902SRodney W. Grimes.Nd translate characters
409b50d902SRodney W. Grimes.Sh SYNOPSIS
418fe908efSRuslan Ermilov.Nm
42dfac4f36STim J. Robbins.Op Fl Ccsu
439b50d902SRodney W. Grimes.Ar string1 string2
448fe908efSRuslan Ermilov.Nm
45dfac4f36STim J. Robbins.Op Fl Ccu
469b50d902SRodney W. Grimes.Fl d
479b50d902SRodney W. Grimes.Ar string1
488fe908efSRuslan Ermilov.Nm
49dfac4f36STim J. Robbins.Op Fl Ccu
509b50d902SRodney W. Grimes.Fl s
519b50d902SRodney W. Grimes.Ar string1
528fe908efSRuslan Ermilov.Nm
53dfac4f36STim J. Robbins.Op Fl Ccu
549b50d902SRodney W. Grimes.Fl ds
559b50d902SRodney W. Grimes.Ar string1 string2
569b50d902SRodney W. Grimes.Sh DESCRIPTION
579b50d902SRodney W. GrimesThe
58af647767SPhilippe Charnier.Nm
599b50d902SRodney W. Grimesutility copies the standard input to the standard output with substitution
609b50d902SRodney W. Grimesor deletion of selected characters.
619b50d902SRodney W. Grimes.Pp
629b50d902SRodney W. GrimesThe following options are available:
639b50d902SRodney W. Grimes.Bl -tag -width Ds
64dfac4f36STim J. Robbins.It Fl C
65dfac4f36STim J. RobbinsComplement the set of characters in
669b50d902SRodney W. Grimes.Ar string1 ,
67dfac4f36STim J. Robbinsthat is
6806e482e6SRuslan Ermilov.Dq Fl C Li ab
69dfac4f36STim J. Robbinsincludes every character except for
7006e482e6SRuslan Ermilov.Ql a
71dfac4f36STim J. Robbinsand
7206e482e6SRuslan Ermilov.Ql b .
73dfac4f36STim J. Robbins.It Fl c
74dfac4f36STim J. RobbinsSame as
75dfac4f36STim J. Robbins.Fl C
76e263a4b4STim J. Robbinsbut complement the set of values in
77dfac4f36STim J. Robbins.Ar string1 .
789b50d902SRodney W. Grimes.It Fl d
796eb0710eSTim J. RobbinsDelete characters in
806eb0710eSTim J. Robbins.Ar string1
816eb0710eSTim J. Robbinsfrom the input.
829b50d902SRodney W. Grimes.It Fl s
836eb0710eSTim J. RobbinsSqueeze multiple occurrences of the characters listed in the last
849b50d902SRodney W. Grimesoperand (either
859b50d902SRodney W. Grimes.Ar string1
869b50d902SRodney W. Grimesor
879b50d902SRodney W. Grimes.Ar string2 )
889b50d902SRodney W. Grimesin the input into a single instance of the character.
899b50d902SRodney W. GrimesThis occurs after all deletion and translation is completed.
9069bd8767SWolfgang Helbig.It Fl u
916eb0710eSTim J. RobbinsGuarantee that any output is unbuffered.
929b50d902SRodney W. Grimes.El
939b50d902SRodney W. Grimes.Pp
949b50d902SRodney W. GrimesIn the first synopsis form, the characters in
959b50d902SRodney W. Grimes.Ar string1
969b50d902SRodney W. Grimesare translated into the characters in
979b50d902SRodney W. Grimes.Ar string2
989b50d902SRodney W. Grimeswhere the first character in
999b50d902SRodney W. Grimes.Ar string1
1009b50d902SRodney W. Grimesis translated into the first character in
1019b50d902SRodney W. Grimes.Ar string2
1029b50d902SRodney W. Grimesand so on.
1039b50d902SRodney W. GrimesIf
1049b50d902SRodney W. Grimes.Ar string1
1059b50d902SRodney W. Grimesis longer than
1069b50d902SRodney W. Grimes.Ar string2 ,
1079b50d902SRodney W. Grimesthe last character found in
1089b50d902SRodney W. Grimes.Ar string2
1099b50d902SRodney W. Grimesis duplicated until
1109b50d902SRodney W. Grimes.Ar string1
1119b50d902SRodney W. Grimesis exhausted.
1129b50d902SRodney W. Grimes.Pp
1139b50d902SRodney W. GrimesIn the second synopsis form, the characters in
1149b50d902SRodney W. Grimes.Ar string1
1159b50d902SRodney W. Grimesare deleted from the input.
1169b50d902SRodney W. Grimes.Pp
1179b50d902SRodney W. GrimesIn the third synopsis form, the characters in
1189b50d902SRodney W. Grimes.Ar string1
1199b50d902SRodney W. Grimesare compressed as described for the
1209b50d902SRodney W. Grimes.Fl s
1219b50d902SRodney W. Grimesoption.
1229b50d902SRodney W. Grimes.Pp
1239b50d902SRodney W. GrimesIn the fourth synopsis form, the characters in
1249b50d902SRodney W. Grimes.Ar string1
1259b50d902SRodney W. Grimesare deleted from the input, and the characters in
1269b50d902SRodney W. Grimes.Ar string2
1279b50d902SRodney W. Grimesare compressed as described for the
1289b50d902SRodney W. Grimes.Fl s
1299b50d902SRodney W. Grimesoption.
1309b50d902SRodney W. Grimes.Pp
1319b50d902SRodney W. GrimesThe following conventions can be used in
1329b50d902SRodney W. Grimes.Ar string1
1339b50d902SRodney W. Grimesand
1349b50d902SRodney W. Grimes.Ar string2
1359b50d902SRodney W. Grimesto specify sets of characters:
1369b50d902SRodney W. Grimes.Bl -tag -width [:equiv:]
1379b50d902SRodney W. Grimes.It character
1389b50d902SRodney W. GrimesAny character not described by one of the following conventions
1399b50d902SRodney W. Grimesrepresents itself.
1409b50d902SRodney W. Grimes.It \eoctal
1419b50d902SRodney W. GrimesA backslash followed by 1, 2 or 3 octal digits represents a character
1429b50d902SRodney W. Grimeswith that encoded value.
1439b50d902SRodney W. GrimesTo follow an octal sequence with a digit as a character, left zero-pad
1449b50d902SRodney W. Grimesthe octal sequence to the full 3 octal digits.
1459b50d902SRodney W. Grimes.It \echaracter
1469b50d902SRodney W. GrimesA backslash followed by certain special characters maps to special
1479b50d902SRodney W. Grimesvalues.
1489597e1c2SRuslan Ermilov.Bl -column "\ea"
149c2965cd1SJoel Dahl.It "\ea	<alert character>"
150c2965cd1SJoel Dahl.It "\eb	<backspace>"
151c2965cd1SJoel Dahl.It "\ef	<form-feed>"
152c2965cd1SJoel Dahl.It "\en	<newline>"
153c2965cd1SJoel Dahl.It "\er	<carriage return>"
154c2965cd1SJoel Dahl.It "\et	<tab>"
155c2965cd1SJoel Dahl.It "\ev	<vertical tab>"
1569b50d902SRodney W. Grimes.El
157726b61abSRuslan Ermilov.Pp
1589b50d902SRodney W. GrimesA backslash followed by any other character maps to that character.
1599b50d902SRodney W. Grimes.It c-c
16021f53e91SAndrey A. ChernovFor non-octal range endpoints
16121f53e91SAndrey A. Chernovrepresents the range of characters between the range endpoints, inclusive,
162a508a04dSAndrey A. Chernovin ascending order,
163a508a04dSAndrey A. Chernovas defined by the collation sequence.
16421f53e91SAndrey A. ChernovIf either or both of the range endpoints are octal sequences, it
16521f53e91SAndrey A. Chernovrepresents the range of specific coded values between the
16621f53e91SAndrey A. Chernovrange endpoints, inclusive.
1675b4fa425SAndrey A. Chernov.Pp
1685b4fa425SAndrey A. Chernov.Bf Em
1695b4fa425SAndrey A. ChernovSee the
1705b4fa425SAndrey A. Chernov.Sx COMPATIBILITY
1715b4fa425SAndrey A. Chernovsection below for an important note regarding
1725b4fa425SAndrey A. Chernovdifferences in the way the current
1735b4fa425SAndrey A. Chernovimplementation interprets range expressions differently from
1745b4fa425SAndrey A. Chernovprevious implementations.
1750b651019STim J. Robbins.Ef
1769b50d902SRodney W. Grimes.It [:class:]
1779b50d902SRodney W. GrimesRepresents all characters belonging to the defined character class.
1789b50d902SRodney W. GrimesClass names are:
1790414904dSRuslan Ermilov.Bl -column "phonogram"
180c2965cd1SJoel Dahl.It "alnum	<alphanumeric characters>"
181c2965cd1SJoel Dahl.It "alpha	<alphabetic characters>"
182c2965cd1SJoel Dahl.It "blank	<whitespace characters>"
183c2965cd1SJoel Dahl.It "cntrl	<control characters>"
184c2965cd1SJoel Dahl.It "digit	<numeric characters>"
185c2965cd1SJoel Dahl.It "graph	<graphic characters>"
186c2965cd1SJoel Dahl.It "ideogram	<ideographic characters>"
187c2965cd1SJoel Dahl.It "lower	<lower-case alphabetic characters>"
188c2965cd1SJoel Dahl.It "phonogram	<phonographic characters>"
189c2965cd1SJoel Dahl.It "print	<printable characters>"
190c2965cd1SJoel Dahl.It "punct	<punctuation characters>"
191c2965cd1SJoel Dahl.It "rune	<valid characters>"
192c2965cd1SJoel Dahl.It "space	<space characters>"
193c2965cd1SJoel Dahl.It "special	<special characters>"
194c2965cd1SJoel Dahl.It "upper	<upper-case characters>"
195c2965cd1SJoel Dahl.It "xdigit	<hexadecimal characters>"
1969b50d902SRodney W. Grimes.El
1979b50d902SRodney W. Grimes.Pp
1989b88faecSRuslan Ermilov.\" All classes may be used in
1999b88faecSRuslan Ermilov.\" .Ar string1 ,
2009b88faecSRuslan Ermilov.\" and in
2019b88faecSRuslan Ermilov.\" .Ar string2
2029b88faecSRuslan Ermilov.\" when both the
2039b88faecSRuslan Ermilov.\" .Fl d
2049b88faecSRuslan Ermilov.\" and
2059b88faecSRuslan Ermilov.\" .Fl s
2069b88faecSRuslan Ermilov.\" options are specified.
2079b88faecSRuslan Ermilov.\" Otherwise, only the classes ``upper'' and ``lower'' may be used in
2089b88faecSRuslan Ermilov.\" .Ar string2
2099b88faecSRuslan Ermilov.\" and then only when the corresponding class (``upper'' for ``lower''
2109b88faecSRuslan Ermilov.\" and vice-versa) is specified in the same relative position in
2119b88faecSRuslan Ermilov.\" .Ar string1 .
2129b88faecSRuslan Ermilov.\" .Pp
21326bdc1d1STim J. RobbinsWhen
21426bdc1d1STim J. Robbins.Dq Li [:lower:]
21526bdc1d1STim J. Robbinsappears in
216bc44c44aSAndrey A. Chernov.Ar string1
21726bdc1d1STim J. Robbinsand
21826bdc1d1STim J. Robbins.Dq Li [:upper:]
21926bdc1d1STim J. Robbinsappears in the same relative position in
220bc44c44aSAndrey A. Chernov.Ar string2 ,
2218ad968eeSAndrey A. Chernovit represents the characters pairs from the
222bc44c44aSAndrey A. Chernov.Dv toupper
223bc44c44aSAndrey A. Chernovmapping in the
224bc44c44aSAndrey A. Chernov.Ev LC_CTYPE
225bc44c44aSAndrey A. Chernovcategory of the current locale.
22626bdc1d1STim J. RobbinsWhen
22726bdc1d1STim J. Robbins.Dq Li [:upper:]
22826bdc1d1STim J. Robbinsappears in
229bc44c44aSAndrey A. Chernov.Ar string1
23026bdc1d1STim J. Robbinsand
23126bdc1d1STim J. Robbins.Dq Li [:lower:]
23226bdc1d1STim J. Robbinsappears in the same relative position in
233bc44c44aSAndrey A. Chernov.Ar string2 ,
2348ad968eeSAndrey A. Chernovit represents the characters pairs from the
235bc44c44aSAndrey A. Chernov.Dv tolower
236bc44c44aSAndrey A. Chernovmapping in the
237bc44c44aSAndrey A. Chernov.Ev LC_CTYPE
238bc44c44aSAndrey A. Chernovcategory of the current locale.
239bc44c44aSAndrey A. Chernov.Pp
2408ad968eeSAndrey A. ChernovWith the exception of case conversion,
2418ad968eeSAndrey A. Chernovcharacters in the classes are in unspecified order.
2429b50d902SRodney W. Grimes.Pp
243b9a86ec9SPhilippe CharnierFor specific information as to which
244b9a86ec9SPhilippe Charnier.Tn ASCII
245b9a86ec9SPhilippe Charniercharacters are included
2469b50d902SRodney W. Grimesin these classes, see
2479b50d902SRodney W. Grimes.Xr ctype 3
2489b50d902SRodney W. Grimesand related manual pages.
2499b50d902SRodney W. Grimes.It [=equiv=]
25085f6c317STim J. RobbinsRepresents all characters belonging to the same equivalence class as
25185f6c317STim J. Robbins.Ar equiv ,
25285f6c317STim J. Robbinsordered by their encoded values.
2539b50d902SRodney W. Grimes.It [#*n]
2549b50d902SRodney W. GrimesRepresents
2559b50d902SRodney W. Grimes.Ar n
2569b50d902SRodney W. Grimesrepeated occurrences of the character represented by
2579b50d902SRodney W. Grimes.Ar # .
2589b50d902SRodney W. GrimesThis
2599b50d902SRodney W. Grimesexpression is only valid when it occurs in
2609b50d902SRodney W. Grimes.Ar string2 .
2619b50d902SRodney W. GrimesIf
2629b50d902SRodney W. Grimes.Ar n
2639b50d902SRodney W. Grimesis omitted or is zero, it is be interpreted as large enough to extend
2649b50d902SRodney W. Grimes.Ar string2
2659b50d902SRodney W. Grimessequence to the length of
2669b50d902SRodney W. Grimes.Ar string1 .
2679b50d902SRodney W. GrimesIf
2689b50d902SRodney W. Grimes.Ar n
2699b50d902SRodney W. Grimeshas a leading zero, it is interpreted as an octal value, otherwise,
27036a142c4SRuslan Ermilovit is interpreted as a decimal value.
2719b50d902SRodney W. Grimes.El
27285f6c317STim J. Robbins.Sh ENVIRONMENT
27385f6c317STim J. RobbinsThe
27406e482e6SRuslan Ermilov.Ev LANG , LC_ALL , LC_CTYPE
27585f6c317STim J. Robbinsand
27685f6c317STim J. Robbins.Ev LC_COLLATE
27785f6c317STim J. Robbinsenvironment variables affect the execution of
27885f6c317STim J. Robbins.Nm
27985f6c317STim J. Robbinsas described in
28085f6c317STim J. Robbins.Xr environ 7 .
2816c7216dfSRuslan Ermilov.Sh EXIT STATUS
2826c7216dfSRuslan Ermilov.Ex -std
2839b50d902SRodney W. Grimes.Sh EXAMPLES
2849b50d902SRodney W. GrimesThe following examples are shown as given to the shell:
285726b61abSRuslan Ermilov.Pp
2869b50d902SRodney W. GrimesCreate a list of the words in file1, one per line, where a word is taken to
2879b50d902SRodney W. Grimesbe a maximal string of letters.
288726b61abSRuslan Ermilov.Pp
2899b50d902SRodney W. Grimes.D1 Li "tr -cs \*q[:alpha:]\*q \*q\en\*q < file1"
290726b61abSRuslan Ermilov.Pp
2919b50d902SRodney W. GrimesTranslate the contents of file1 to upper-case.
292726b61abSRuslan Ermilov.Pp
2939b50d902SRodney W. Grimes.D1 Li "tr \*q[:lower:]\*q \*q[:upper:]\*q < file1"
294726b61abSRuslan Ermilov.Pp
2950b651019STim J. Robbins(This should be preferred over the traditional
2960b651019STim J. Robbins.Ux
2970b651019STim J. Robbinsidiom of
2983baccdb9SRuslan Ermilov.Dq Li "tr a-z A-Z" ,
2990b651019STim J. Robbinssince it works correctly in all locales.)
3000b651019STim J. Robbins.Pp
3019b50d902SRodney W. GrimesStrip out non-printable characters from file1.
302726b61abSRuslan Ermilov.Pp
3039b50d902SRodney W. Grimes.D1 Li "tr -cd \*q[:print:]\*q < file1"
30485f6c317STim J. Robbins.Pp
30585f6c317STim J. RobbinsRemove diacritical marks from all accented variants of the letter
30606e482e6SRuslan Ermilov.Ql e :
30785f6c317STim J. Robbins.Pp
30885f6c317STim J. Robbins.Dl "tr \*q[=e=]\*q \*qe\*q"
3099b50d902SRodney W. Grimes.Sh COMPATIBILITY
3105b4fa425SAndrey A. ChernovPrevious
3110b651019STim J. Robbins.Fx
3120b651019STim J. Robbinsimplementations of
3130b651019STim J. Robbins.Nm
3140b651019STim J. Robbinsdid not order characters in range expressions according to the current
3155b4fa425SAndrey A. Chernovlocale's collation order, making it possible to convert unaccented Latin
3165b4fa425SAndrey A. Chernovcharacters (esp.\& as found in English text) from upper to lower case using
3170b651019STim J. Robbinsthe traditional
3180b651019STim J. Robbins.Ux
3190b651019STim J. Robbinsidiom of
3203baccdb9SRuslan Ermilov.Dq Li "tr A-Z a-z" .
3215b4fa425SAndrey A. ChernovSince
3225b4fa425SAndrey A. Chernov.Nm
3235b4fa425SAndrey A. Chernovnow obeys the locale's collation order, this idiom may not produce
3245b4fa425SAndrey A. Chernovcorrect results when there is not a 1:1 mapping between lower and
3255b4fa425SAndrey A. Chernovupper case, or when the order of characters within the two cases differs.
3260b651019STim J. RobbinsAs noted in the
3270b651019STim J. Robbins.Sx EXAMPLES
3280b651019STim J. Robbinssection above, the character class expressions
3293baccdb9SRuslan Ermilov.Dq Li [:lower:]
3300b651019STim J. Robbinsand
3313baccdb9SRuslan Ermilov.Dq Li [:upper:]
3320b651019STim J. Robbinsshould be used instead of explicit character ranges like
3333baccdb9SRuslan Ermilov.Dq Li a-z
3340b651019STim J. Robbinsand
3353baccdb9SRuslan Ermilov.Dq Li A-Z .
3360b651019STim J. Robbins.Pp
337*4573d501SAndrey A. Chernov.Dq Li [=equiv=]
338*4573d501SAndrey A. Chernovexpression and collation for ranges
339*4573d501SAndrey A. Chernovare implemented for single byte locales only.
340*4573d501SAndrey A. Chernov.Pp
3419b50d902SRodney W. GrimesSystem V has historically implemented character ranges using the syntax
34226bdc1d1STim J. Robbins.Dq Li [c-c]
34326bdc1d1STim J. Robbinsinstead of the
34426bdc1d1STim J. Robbins.Dq Li c-c
34526bdc1d1STim J. Robbinsused by historic
346753d686dSRuslan Ermilov.Bx
347753d686dSRuslan Ermilovimplementations and
3489b50d902SRodney W. Grimesstandardized by POSIX.
3499b50d902SRodney W. GrimesSystem V shell scripts should work under this implementation as long as
3506a3e8b0aSRuslan Ermilovthe range is intended to map in another range, i.e., the command
35126bdc1d1STim J. Robbins.Dq Li "tr [a-z] [A-Z]"
35226bdc1d1STim J. Robbinswill work as it will map the
35326bdc1d1STim J. Robbins.Ql \&[
35426bdc1d1STim J. Robbinscharacter in
3559b50d902SRodney W. Grimes.Ar string1
35626bdc1d1STim J. Robbinsto the
35726bdc1d1STim J. Robbins.Ql \&[
35826bdc1d1STim J. Robbinscharacter in
3599b50d902SRodney W. Grimes.Ar string2 .
3609b50d902SRodney W. GrimesHowever, if the shell script is deleting or squeezing characters as in
36126bdc1d1STim J. Robbinsthe command
36226bdc1d1STim J. Robbins.Dq Li "tr -d [a-z]" ,
36326bdc1d1STim J. Robbinsthe characters
36426bdc1d1STim J. Robbins.Ql \&[
36526bdc1d1STim J. Robbinsand
36626bdc1d1STim J. Robbins.Ql \&]
36726bdc1d1STim J. Robbinswill be
3689b50d902SRodney W. Grimesincluded in the deletion or compression list which would not have happened
369d64ada50SJens Schweikhardtunder a historic System V implementation.
37026bdc1d1STim J. RobbinsAdditionally, any scripts that depended on the sequence
37126bdc1d1STim J. Robbins.Dq Li a-z
37226bdc1d1STim J. Robbinsto
37326bdc1d1STim J. Robbinsrepresent the three characters
37426bdc1d1STim J. Robbins.Ql a ,
3753baccdb9SRuslan Ermilov.Ql \-
37626bdc1d1STim J. Robbinsand
37726bdc1d1STim J. Robbins.Ql z
37826bdc1d1STim J. Robbinswill have to be
37926bdc1d1STim J. Robbinsrewritten as
38026bdc1d1STim J. Robbins.Dq Li a\e-z .
3819b50d902SRodney W. Grimes.Pp
3829b50d902SRodney W. GrimesThe
383af647767SPhilippe Charnier.Nm
3849b50d902SRodney W. Grimesutility has historically not permitted the manipulation of NUL bytes in
3859b50d902SRodney W. Grimesits input and, additionally, stripped NUL's from its input stream.
3869b50d902SRodney W. GrimesThis implementation has removed this behavior as a bug.
3879b50d902SRodney W. Grimes.Pp
3889b50d902SRodney W. GrimesThe
389af647767SPhilippe Charnier.Nm
3909b50d902SRodney W. Grimesutility has historically been extremely forgiving of syntax errors,
3919b50d902SRodney W. Grimesfor example, the
3929b50d902SRodney W. Grimes.Fl c
3939b50d902SRodney W. Grimesand
3949b50d902SRodney W. Grimes.Fl s
3959b50d902SRodney W. Grimesoptions were ignored unless two strings were specified.
3969b50d902SRodney W. GrimesThis implementation will not permit illegal syntax.
3979b50d902SRodney W. Grimes.Sh STANDARDS
3989b50d902SRodney W. GrimesThe
399af647767SPhilippe Charnier.Nm
400dfac4f36STim J. Robbinsutility conforms to
401dfac4f36STim J. Robbins.St -p1003.1-2001 .
4020414904dSRuslan ErmilovThe
4030414904dSRuslan Ermilov.Dq ideogram ,
4040414904dSRuslan Ermilov.Dq phonogram ,
4050414904dSRuslan Ermilov.Dq rune ,
4060414904dSRuslan Ermilovand
4070414904dSRuslan Ermilov.Dq special
4080414904dSRuslan Ermilovcharacter classes are extensions.
409dfac4f36STim J. Robbins.Pp
4109b50d902SRodney W. GrimesIt should be noted that the feature wherein the last character of
4119b50d902SRodney W. Grimes.Ar string2
4129b50d902SRodney W. Grimesis duplicated if
4139b50d902SRodney W. Grimes.Ar string2
4149b50d902SRodney W. Grimeshas less characters than
4159b50d902SRodney W. Grimes.Ar string1
4169b50d902SRodney W. Grimesis permitted by POSIX but is not required.
4179b50d902SRodney W. GrimesShell scripts attempting to be portable to other POSIX systems should use
41826bdc1d1STim J. Robbinsthe
41926bdc1d1STim J. Robbins.Dq Li [#*]
42026bdc1d1STim J. Robbinsconvention instead of relying on this behavior.
42169bd8767SWolfgang HelbigThe
42269bd8767SWolfgang Helbig.Fl u
42369bd8767SWolfgang Helbigoption is an extension to the
424dfac4f36STim J. Robbins.St -p1003.1-2001
42569bd8767SWolfgang Helbigstandard.
426