1994-05-27 12:33:43 +00:00
|
|
|
.\" Copyright (c) 1991, 1993
|
|
|
|
.\" The Regents of the University of California. All rights reserved.
|
|
|
|
.\"
|
|
|
|
.\" This code is derived from software contributed to Berkeley by
|
|
|
|
.\" the Institute of Electrical and Electronics Engineers, Inc.
|
|
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
.\" 3. All advertising materials mentioning features or use of this software
|
|
|
|
.\" must display the following acknowledgement:
|
|
|
|
.\" This product includes software developed by the University of
|
|
|
|
.\" California, Berkeley and its contributors.
|
|
|
|
.\" 4. Neither the name of the University nor the names of its contributors
|
|
|
|
.\" may be used to endorse or promote products derived from this software
|
|
|
|
.\" without specific prior written permission.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|
|
|
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
.\" SUCH DAMAGE.
|
|
|
|
.\"
|
|
|
|
.\" @(#)tr.1 8.1 (Berkeley) 6/6/93
|
1999-08-28 01:08:13 +00:00
|
|
|
.\" $FreeBSD$
|
1994-05-27 12:33:43 +00:00
|
|
|
.\"
|
2006-10-13 16:13:45 +00:00
|
|
|
.Dd October 13, 2006
|
1994-05-27 12:33:43 +00:00
|
|
|
.Dt TR 1
|
|
|
|
.Os
|
|
|
|
.Sh NAME
|
|
|
|
.Nm tr
|
|
|
|
.Nd translate characters
|
|
|
|
.Sh SYNOPSIS
|
2000-11-20 19:21:22 +00:00
|
|
|
.Nm
|
2002-06-14 08:58:30 +00:00
|
|
|
.Op Fl Ccsu
|
1994-05-27 12:33:43 +00:00
|
|
|
.Ar string1 string2
|
2000-11-20 19:21:22 +00:00
|
|
|
.Nm
|
2002-06-14 08:58:30 +00:00
|
|
|
.Op Fl Ccu
|
1994-05-27 12:33:43 +00:00
|
|
|
.Fl d
|
|
|
|
.Ar string1
|
2000-11-20 19:21:22 +00:00
|
|
|
.Nm
|
2002-06-14 08:58:30 +00:00
|
|
|
.Op Fl Ccu
|
1994-05-27 12:33:43 +00:00
|
|
|
.Fl s
|
|
|
|
.Ar string1
|
2000-11-20 19:21:22 +00:00
|
|
|
.Nm
|
2002-06-14 08:58:30 +00:00
|
|
|
.Op Fl Ccu
|
1994-05-27 12:33:43 +00:00
|
|
|
.Fl ds
|
|
|
|
.Ar string1 string2
|
|
|
|
.Sh DESCRIPTION
|
|
|
|
The
|
1997-08-18 07:24:58 +00:00
|
|
|
.Nm
|
1994-05-27 12:33:43 +00:00
|
|
|
utility copies the standard input to the standard output with substitution
|
|
|
|
or deletion of selected characters.
|
|
|
|
.Pp
|
|
|
|
The following options are available:
|
|
|
|
.Bl -tag -width Ds
|
2002-06-14 08:58:30 +00:00
|
|
|
.It Fl C
|
|
|
|
Complement the set of characters in
|
1994-05-27 12:33:43 +00:00
|
|
|
.Ar string1 ,
|
2002-06-14 08:58:30 +00:00
|
|
|
that is
|
2002-11-26 17:33:37 +00:00
|
|
|
.Dq Fl C Li ab
|
2002-06-14 08:58:30 +00:00
|
|
|
includes every character except for
|
2002-11-26 17:33:37 +00:00
|
|
|
.Ql a
|
2002-06-14 08:58:30 +00:00
|
|
|
and
|
2002-11-26 17:33:37 +00:00
|
|
|
.Ql b .
|
2002-06-14 08:58:30 +00:00
|
|
|
.It Fl c
|
|
|
|
Same as
|
|
|
|
.Fl C
|
2004-07-09 02:33:46 +00:00
|
|
|
but complement the set of values in
|
2002-06-14 08:58:30 +00:00
|
|
|
.Ar string1 .
|
1994-05-27 12:33:43 +00:00
|
|
|
.It Fl d
|
2002-06-14 10:11:41 +00:00
|
|
|
Delete characters in
|
|
|
|
.Ar string1
|
|
|
|
from the input.
|
1994-05-27 12:33:43 +00:00
|
|
|
.It Fl s
|
2002-06-14 10:11:41 +00:00
|
|
|
Squeeze multiple occurrences of the characters listed in the last
|
1994-05-27 12:33:43 +00:00
|
|
|
operand (either
|
|
|
|
.Ar string1
|
|
|
|
or
|
|
|
|
.Ar string2 )
|
|
|
|
in the input into a single instance of the character.
|
|
|
|
This occurs after all deletion and translation is completed.
|
1997-10-12 09:52:49 +00:00
|
|
|
.It Fl u
|
2002-06-14 10:11:41 +00:00
|
|
|
Guarantee that any output is unbuffered.
|
1994-05-27 12:33:43 +00:00
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
In the first synopsis form, the characters in
|
|
|
|
.Ar string1
|
|
|
|
are translated into the characters in
|
|
|
|
.Ar string2
|
|
|
|
where the first character in
|
|
|
|
.Ar string1
|
|
|
|
is translated into the first character in
|
|
|
|
.Ar string2
|
|
|
|
and so on.
|
|
|
|
If
|
|
|
|
.Ar string1
|
|
|
|
is longer than
|
|
|
|
.Ar string2 ,
|
|
|
|
the last character found in
|
|
|
|
.Ar string2
|
|
|
|
is duplicated until
|
|
|
|
.Ar string1
|
|
|
|
is exhausted.
|
|
|
|
.Pp
|
|
|
|
In the second synopsis form, the characters in
|
|
|
|
.Ar string1
|
|
|
|
are deleted from the input.
|
|
|
|
.Pp
|
|
|
|
In the third synopsis form, the characters in
|
|
|
|
.Ar string1
|
|
|
|
are compressed as described for the
|
|
|
|
.Fl s
|
|
|
|
option.
|
|
|
|
.Pp
|
|
|
|
In the fourth synopsis form, the characters in
|
|
|
|
.Ar string1
|
|
|
|
are deleted from the input, and the characters in
|
|
|
|
.Ar string2
|
|
|
|
are compressed as described for the
|
|
|
|
.Fl s
|
|
|
|
option.
|
|
|
|
.Pp
|
|
|
|
The following conventions can be used in
|
|
|
|
.Ar string1
|
|
|
|
and
|
|
|
|
.Ar string2
|
|
|
|
to specify sets of characters:
|
|
|
|
.Bl -tag -width [:equiv:]
|
|
|
|
.It character
|
|
|
|
Any character not described by one of the following conventions
|
|
|
|
represents itself.
|
|
|
|
.It \eoctal
|
|
|
|
A backslash followed by 1, 2 or 3 octal digits represents a character
|
|
|
|
with that encoded value.
|
|
|
|
To follow an octal sequence with a digit as a character, left zero-pad
|
|
|
|
the octal sequence to the full 3 octal digits.
|
|
|
|
.It \echaracter
|
|
|
|
A backslash followed by certain special characters maps to special
|
|
|
|
values.
|
2000-11-10 17:46:15 +00:00
|
|
|
.Pp
|
2001-07-06 10:07:43 +00:00
|
|
|
.Bl -column "\ea"
|
2000-12-19 16:00:12 +00:00
|
|
|
.It "\ea <alert character>
|
|
|
|
.It "\eb <backspace>
|
|
|
|
.It "\ef <form-feed>
|
|
|
|
.It "\en <newline>
|
|
|
|
.It "\er <carriage return>
|
|
|
|
.It "\et <tab>
|
|
|
|
.It "\ev <vertical tab>
|
1994-05-27 12:33:43 +00:00
|
|
|
.El
|
2000-11-10 17:46:15 +00:00
|
|
|
.Pp
|
1994-05-27 12:33:43 +00:00
|
|
|
A backslash followed by any other character maps to that character.
|
|
|
|
.It c-c
|
2003-08-04 04:20:04 +00:00
|
|
|
For non-octal range endpoints
|
|
|
|
represents the range of characters between the range endpoints, inclusive,
|
2003-08-03 03:51:27 +00:00
|
|
|
in ascending order,
|
|
|
|
as defined by the collation sequence.
|
2003-08-04 04:20:04 +00:00
|
|
|
If either or both of the range endpoints are octal sequences, it
|
|
|
|
represents the range of specific coded values between the
|
|
|
|
range endpoints, inclusive.
|
2004-07-23 05:44:04 +00:00
|
|
|
.Pp
|
|
|
|
.Bf Em
|
2005-01-11 10:32:29 +00:00
|
|
|
See the
|
|
|
|
.Sx COMPATIBILITY
|
|
|
|
section below for an important note regarding
|
2004-07-23 05:44:04 +00:00
|
|
|
differences in the way the current
|
|
|
|
implementation interprets range expressions differently from
|
|
|
|
previous implementations.
|
|
|
|
.Ef
|
1994-05-27 12:33:43 +00:00
|
|
|
.It [:class:]
|
|
|
|
Represents all characters belonging to the defined character class.
|
|
|
|
Class names are:
|
2000-11-10 17:46:15 +00:00
|
|
|
.Pp
|
2006-10-13 16:13:45 +00:00
|
|
|
.Bl -column "phonogram"
|
2000-12-19 16:00:12 +00:00
|
|
|
.It "alnum <alphanumeric characters>
|
|
|
|
.It "alpha <alphabetic characters>
|
2006-10-13 16:13:45 +00:00
|
|
|
.It "blank <whitespace characters>
|
2000-12-19 16:00:12 +00:00
|
|
|
.It "cntrl <control characters>
|
|
|
|
.It "digit <numeric characters>
|
|
|
|
.It "graph <graphic characters>
|
2006-10-13 16:13:45 +00:00
|
|
|
.It "ideogram <ideographic characters>
|
2000-12-19 16:00:12 +00:00
|
|
|
.It "lower <lower-case alphabetic characters>
|
2006-10-13 16:13:45 +00:00
|
|
|
.It "phonogram <phonographic characters>
|
2000-12-19 16:00:12 +00:00
|
|
|
.It "print <printable characters>
|
|
|
|
.It "punct <punctuation characters>
|
2006-10-13 16:13:45 +00:00
|
|
|
.It "rune <valid characters>
|
2000-12-19 16:00:12 +00:00
|
|
|
.It "space <space characters>
|
2006-10-13 16:13:45 +00:00
|
|
|
.It "special <special characters>
|
2000-12-19 16:00:12 +00:00
|
|
|
.It "upper <upper-case characters>
|
|
|
|
.It "xdigit <hexadecimal characters>
|
1994-05-27 12:33:43 +00:00
|
|
|
.El
|
|
|
|
.Pp
|
2000-12-19 16:00:12 +00:00
|
|
|
.\" All classes may be used in
|
|
|
|
.\" .Ar string1 ,
|
|
|
|
.\" and in
|
|
|
|
.\" .Ar string2
|
|
|
|
.\" when both the
|
|
|
|
.\" .Fl d
|
|
|
|
.\" and
|
|
|
|
.\" .Fl s
|
|
|
|
.\" options are specified.
|
|
|
|
.\" Otherwise, only the classes ``upper'' and ``lower'' may be used in
|
|
|
|
.\" .Ar string2
|
|
|
|
.\" and then only when the corresponding class (``upper'' for ``lower''
|
|
|
|
.\" and vice-versa) is specified in the same relative position in
|
|
|
|
.\" .Ar string1 .
|
|
|
|
.\" .Pp
|
2004-07-23 06:06:58 +00:00
|
|
|
When
|
|
|
|
.Dq Li [:lower:]
|
|
|
|
appears in
|
2003-08-05 06:00:00 +00:00
|
|
|
.Ar string1
|
2004-07-23 06:06:58 +00:00
|
|
|
and
|
|
|
|
.Dq Li [:upper:]
|
|
|
|
appears in the same relative position in
|
2003-08-05 06:00:00 +00:00
|
|
|
.Ar string2 ,
|
2003-08-05 07:53:28 +00:00
|
|
|
it represents the characters pairs from the
|
2003-08-05 06:00:00 +00:00
|
|
|
.Dv toupper
|
|
|
|
mapping in the
|
|
|
|
.Ev LC_CTYPE
|
|
|
|
category of the current locale.
|
2004-07-23 06:06:58 +00:00
|
|
|
When
|
|
|
|
.Dq Li [:upper:]
|
|
|
|
appears in
|
2003-08-05 06:00:00 +00:00
|
|
|
.Ar string1
|
2004-07-23 06:06:58 +00:00
|
|
|
and
|
|
|
|
.Dq Li [:lower:]
|
|
|
|
appears in the same relative position in
|
2003-08-05 06:00:00 +00:00
|
|
|
.Ar string2 ,
|
2003-08-05 07:53:28 +00:00
|
|
|
it represents the characters pairs from the
|
2003-08-05 06:00:00 +00:00
|
|
|
.Dv tolower
|
|
|
|
mapping in the
|
|
|
|
.Ev LC_CTYPE
|
|
|
|
category of the current locale.
|
|
|
|
.Pp
|
2003-08-05 07:53:28 +00:00
|
|
|
With the exception of case conversion,
|
|
|
|
characters in the classes are in unspecified order.
|
1994-05-27 12:33:43 +00:00
|
|
|
.Pp
|
2002-10-17 13:04:49 +00:00
|
|
|
For specific information as to which
|
|
|
|
.Tn ASCII
|
|
|
|
characters are included
|
1994-05-27 12:33:43 +00:00
|
|
|
in these classes, see
|
|
|
|
.Xr ctype 3
|
|
|
|
and related manual pages.
|
|
|
|
.It [=equiv=]
|
2002-06-14 07:37:08 +00:00
|
|
|
Represents all characters belonging to the same equivalence class as
|
|
|
|
.Ar equiv ,
|
|
|
|
ordered by their encoded values.
|
1994-05-27 12:33:43 +00:00
|
|
|
.It [#*n]
|
|
|
|
Represents
|
|
|
|
.Ar n
|
|
|
|
repeated occurrences of the character represented by
|
|
|
|
.Ar # .
|
|
|
|
This
|
|
|
|
expression is only valid when it occurs in
|
|
|
|
.Ar string2 .
|
|
|
|
If
|
|
|
|
.Ar n
|
|
|
|
is omitted or is zero, it is be interpreted as large enough to extend
|
|
|
|
.Ar string2
|
|
|
|
sequence to the length of
|
|
|
|
.Ar string1 .
|
|
|
|
If
|
|
|
|
.Ar n
|
|
|
|
has a leading zero, it is interpreted as an octal value, otherwise,
|
2005-02-13 23:45:54 +00:00
|
|
|
it is interpreted as a decimal value.
|
1994-05-27 12:33:43 +00:00
|
|
|
.El
|
2002-06-14 07:37:08 +00:00
|
|
|
.Sh ENVIRONMENT
|
|
|
|
The
|
2002-11-26 17:33:37 +00:00
|
|
|
.Ev LANG , LC_ALL , LC_CTYPE
|
2002-06-14 07:37:08 +00:00
|
|
|
and
|
|
|
|
.Ev LC_COLLATE
|
|
|
|
environment variables affect the execution of
|
|
|
|
.Nm
|
|
|
|
as described in
|
|
|
|
.Xr environ 7 .
|
2005-01-18 13:43:56 +00:00
|
|
|
.Sh EXIT STATUS
|
|
|
|
.Ex -std
|
1994-05-27 12:33:43 +00:00
|
|
|
.Sh EXAMPLES
|
|
|
|
The following examples are shown as given to the shell:
|
2000-11-10 17:46:15 +00:00
|
|
|
.Pp
|
1994-05-27 12:33:43 +00:00
|
|
|
Create a list of the words in file1, one per line, where a word is taken to
|
|
|
|
be a maximal string of letters.
|
2000-11-10 17:46:15 +00:00
|
|
|
.Pp
|
1994-05-27 12:33:43 +00:00
|
|
|
.D1 Li "tr -cs \*q[:alpha:]\*q \*q\en\*q < file1"
|
2000-11-10 17:46:15 +00:00
|
|
|
.Pp
|
1994-05-27 12:33:43 +00:00
|
|
|
Translate the contents of file1 to upper-case.
|
2000-11-10 17:46:15 +00:00
|
|
|
.Pp
|
1994-05-27 12:33:43 +00:00
|
|
|
.D1 Li "tr \*q[:lower:]\*q \*q[:upper:]\*q < file1"
|
2000-11-10 17:46:15 +00:00
|
|
|
.Pp
|
2004-07-23 05:44:04 +00:00
|
|
|
(This should be preferred over the traditional
|
|
|
|
.Ux
|
|
|
|
idiom of
|
2005-01-11 10:32:29 +00:00
|
|
|
.Dq Li "tr a-z A-Z" ,
|
2004-07-23 05:44:04 +00:00
|
|
|
since it works correctly in all locales.)
|
|
|
|
.Pp
|
1994-05-27 12:33:43 +00:00
|
|
|
Strip out non-printable characters from file1.
|
2000-11-10 17:46:15 +00:00
|
|
|
.Pp
|
1994-05-27 12:33:43 +00:00
|
|
|
.D1 Li "tr -cd \*q[:print:]\*q < file1"
|
2002-06-14 07:37:08 +00:00
|
|
|
.Pp
|
|
|
|
Remove diacritical marks from all accented variants of the letter
|
2002-11-26 17:33:37 +00:00
|
|
|
.Ql e :
|
2002-06-14 07:37:08 +00:00
|
|
|
.Pp
|
|
|
|
.Dl "tr \*q[=e=]\*q \*qe\*q"
|
1994-05-27 12:33:43 +00:00
|
|
|
.Sh COMPATIBILITY
|
2004-07-23 05:44:04 +00:00
|
|
|
Previous
|
|
|
|
.Fx
|
|
|
|
implementations of
|
|
|
|
.Nm
|
|
|
|
did not order characters in range expressions according to the current
|
|
|
|
locale's collation order, making it possible to convert unaccented Latin
|
2005-01-11 10:32:29 +00:00
|
|
|
characters (esp.\& as found in English text) from upper to lower case using
|
2004-07-23 05:44:04 +00:00
|
|
|
the traditional
|
|
|
|
.Ux
|
|
|
|
idiom of
|
2005-01-11 10:32:29 +00:00
|
|
|
.Dq Li "tr A-Z a-z" .
|
2004-07-23 05:44:04 +00:00
|
|
|
Since
|
|
|
|
.Nm
|
|
|
|
now obeys the locale's collation order, this idiom may not produce
|
|
|
|
correct results when there is not a 1:1 mapping between lower and
|
|
|
|
upper case, or when the order of characters within the two cases differs.
|
|
|
|
As noted in the
|
|
|
|
.Sx EXAMPLES
|
|
|
|
section above, the character class expressions
|
2005-01-11 10:32:29 +00:00
|
|
|
.Dq Li [:lower:]
|
2004-07-23 05:44:04 +00:00
|
|
|
and
|
2005-01-11 10:32:29 +00:00
|
|
|
.Dq Li [:upper:]
|
2004-07-23 05:44:04 +00:00
|
|
|
should be used instead of explicit character ranges like
|
2005-01-11 10:32:29 +00:00
|
|
|
.Dq Li a-z
|
2004-07-23 05:44:04 +00:00
|
|
|
and
|
2005-01-11 10:32:29 +00:00
|
|
|
.Dq Li A-Z .
|
2004-07-23 05:44:04 +00:00
|
|
|
.Pp
|
1994-05-27 12:33:43 +00:00
|
|
|
System V has historically implemented character ranges using the syntax
|
2004-07-23 06:06:58 +00:00
|
|
|
.Dq Li [c-c]
|
|
|
|
instead of the
|
|
|
|
.Dq Li c-c
|
|
|
|
used by historic
|
2001-08-14 10:01:54 +00:00
|
|
|
.Bx
|
|
|
|
implementations and
|
1994-05-27 12:33:43 +00:00
|
|
|
standardized by POSIX.
|
|
|
|
System V shell scripts should work under this implementation as long as
|
2004-07-02 22:22:35 +00:00
|
|
|
the range is intended to map in another range, i.e., the command
|
2004-07-23 06:06:58 +00:00
|
|
|
.Dq Li "tr [a-z] [A-Z]"
|
|
|
|
will work as it will map the
|
|
|
|
.Ql \&[
|
|
|
|
character in
|
1994-05-27 12:33:43 +00:00
|
|
|
.Ar string1
|
2004-07-23 06:06:58 +00:00
|
|
|
to the
|
|
|
|
.Ql \&[
|
|
|
|
character in
|
2001-02-01 16:38:02 +00:00
|
|
|
.Ar string2 .
|
1994-05-27 12:33:43 +00:00
|
|
|
However, if the shell script is deleting or squeezing characters as in
|
2004-07-23 06:06:58 +00:00
|
|
|
the command
|
|
|
|
.Dq Li "tr -d [a-z]" ,
|
|
|
|
the characters
|
|
|
|
.Ql \&[
|
|
|
|
and
|
|
|
|
.Ql \&]
|
|
|
|
will be
|
1994-05-27 12:33:43 +00:00
|
|
|
included in the deletion or compression list which would not have happened
|
2002-12-30 21:18:15 +00:00
|
|
|
under a historic System V implementation.
|
2004-07-23 06:06:58 +00:00
|
|
|
Additionally, any scripts that depended on the sequence
|
|
|
|
.Dq Li a-z
|
|
|
|
to
|
|
|
|
represent the three characters
|
|
|
|
.Ql a ,
|
2005-01-11 10:32:29 +00:00
|
|
|
.Ql \-
|
2004-07-23 06:06:58 +00:00
|
|
|
and
|
|
|
|
.Ql z
|
|
|
|
will have to be
|
|
|
|
rewritten as
|
|
|
|
.Dq Li a\e-z .
|
1994-05-27 12:33:43 +00:00
|
|
|
.Pp
|
|
|
|
The
|
1997-08-18 07:24:58 +00:00
|
|
|
.Nm
|
1994-05-27 12:33:43 +00:00
|
|
|
utility has historically not permitted the manipulation of NUL bytes in
|
|
|
|
its input and, additionally, stripped NUL's from its input stream.
|
|
|
|
This implementation has removed this behavior as a bug.
|
|
|
|
.Pp
|
|
|
|
The
|
1997-08-18 07:24:58 +00:00
|
|
|
.Nm
|
1994-05-27 12:33:43 +00:00
|
|
|
utility has historically been extremely forgiving of syntax errors,
|
|
|
|
for example, the
|
|
|
|
.Fl c
|
|
|
|
and
|
|
|
|
.Fl s
|
|
|
|
options were ignored unless two strings were specified.
|
|
|
|
This implementation will not permit illegal syntax.
|
|
|
|
.Sh STANDARDS
|
|
|
|
The
|
1997-08-18 07:24:58 +00:00
|
|
|
.Nm
|
2002-06-14 08:58:30 +00:00
|
|
|
utility conforms to
|
|
|
|
.St -p1003.1-2001 .
|
2006-10-13 16:13:45 +00:00
|
|
|
The
|
|
|
|
.Dq ideogram ,
|
|
|
|
.Dq phonogram ,
|
|
|
|
.Dq rune ,
|
|
|
|
and
|
|
|
|
.Dq special
|
|
|
|
character classes are extensions.
|
2002-06-14 08:58:30 +00:00
|
|
|
.Pp
|
1994-05-27 12:33:43 +00:00
|
|
|
It should be noted that the feature wherein the last character of
|
|
|
|
.Ar string2
|
|
|
|
is duplicated if
|
|
|
|
.Ar string2
|
|
|
|
has less characters than
|
|
|
|
.Ar string1
|
|
|
|
is permitted by POSIX but is not required.
|
|
|
|
Shell scripts attempting to be portable to other POSIX systems should use
|
2004-07-23 06:06:58 +00:00
|
|
|
the
|
|
|
|
.Dq Li [#*]
|
|
|
|
convention instead of relying on this behavior.
|
1997-10-12 09:52:49 +00:00
|
|
|
The
|
|
|
|
.Fl u
|
|
|
|
option is an extension to the
|
2002-06-14 08:58:30 +00:00
|
|
|
.St -p1003.1-2001
|
1997-10-12 09:52:49 +00:00
|
|
|
standard.
|