| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | .\" $NetBSD: uniq.1,v 1.12 2010/10/06 06:43:26 dholland Exp $ | | 1 | .\" $NetBSD: uniq.1,v 1.13 2012/08/26 14:13:50 wiz Exp $ |
2 | .\" | | 2 | .\" |
3 | .\" Copyright (c) 1991, 1993 | | 3 | .\" Copyright (c) 1991, 1993 |
4 | .\" The Regents of the University of California. All rights reserved. | | 4 | .\" The Regents of the University of California. All rights reserved. |
5 | .\" | | 5 | .\" |
6 | .\" This code is derived from software contributed to Berkeley by | | 6 | .\" This code is derived from software contributed to Berkeley by |
7 | .\" the Institute of Electrical and Electronics Engineers, Inc. | | 7 | .\" the Institute of Electrical and Electronics Engineers, Inc. |
8 | .\" | | 8 | .\" |
9 | .\" Redistribution and use in source and binary forms, with or without | | 9 | .\" Redistribution and use in source and binary forms, with or without |
10 | .\" modification, are permitted provided that the following conditions | | 10 | .\" modification, are permitted provided that the following conditions |
11 | .\" are met: | | 11 | .\" are met: |
12 | .\" 1. Redistributions of source code must retain the above copyright | | 12 | .\" 1. Redistributions of source code must retain the above copyright |
13 | .\" notice, this list of conditions and the following disclaimer. | | 13 | .\" notice, this list of conditions and the following disclaimer. |
14 | .\" 2. Redistributions in binary form must reproduce the above copyright | | 14 | .\" 2. Redistributions in binary form must reproduce the above copyright |
| @@ -22,27 +22,27 @@ | | | @@ -22,27 +22,27 @@ |
22 | .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | | 22 | .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
23 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | | 23 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
24 | .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | | 24 | .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE |
25 | .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | | 25 | .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
26 | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | | 26 | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
27 | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | | 27 | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
28 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | | 28 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
29 | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | | 29 | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
30 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | | 30 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
31 | .\" SUCH DAMAGE. | | 31 | .\" SUCH DAMAGE. |
32 | .\" | | 32 | .\" |
33 | .\" @(#)uniq.1 8.1 (Berkeley) 6/6/93 | | 33 | .\" @(#)uniq.1 8.1 (Berkeley) 6/6/93 |
34 | .\" | | 34 | .\" |
35 | .Dd January 6, 2007 | | 35 | .Dd August 26, 2012 |
36 | .Dt UNIQ 1 | | 36 | .Dt UNIQ 1 |
37 | .Os | | 37 | .Os |
38 | .Sh NAME | | 38 | .Sh NAME |
39 | .Nm uniq | | 39 | .Nm uniq |
40 | .Nd report or filter out repeated lines in a file | | 40 | .Nd report or filter out repeated lines in a file |
41 | .Sh SYNOPSIS | | 41 | .Sh SYNOPSIS |
42 | .Nm | | 42 | .Nm |
43 | .Op Fl cdu | | 43 | .Op Fl cdu |
44 | .Op Fl f Ar fields | | 44 | .Op Fl f Ar fields |
45 | .Op Fl s Ar chars | | 45 | .Op Fl s Ar chars |
46 | .Oo | | 46 | .Oo |
47 | .Ar input_file | | 47 | .Ar input_file |
48 | .Op Ar output_file | | 48 | .Op Ar output_file |
| @@ -60,68 +60,70 @@ so it may be necessary to sort the files | | | @@ -60,68 +60,70 @@ so it may be necessary to sort the files |
60 | The following options are available: | | 60 | The following options are available: |
61 | .Bl -tag -width Ds | | 61 | .Bl -tag -width Ds |
62 | .It Fl c | | 62 | .It Fl c |
63 | Precede each output line with the count of the number of times the line | | 63 | Precede each output line with the count of the number of times the line |
64 | occurred in the input, followed by a single space. | | 64 | occurred in the input, followed by a single space. |
65 | .It Fl d | | 65 | .It Fl d |
66 | Don't output lines that are not repeated in the input. | | 66 | Don't output lines that are not repeated in the input. |
67 | .It Fl f Ar fields | | 67 | .It Fl f Ar fields |
68 | Ignore the first | | 68 | Ignore the first |
69 | .Ar fields | | 69 | .Ar fields |
70 | in each input line when doing comparisons. | | 70 | in each input line when doing comparisons. |
71 | A field is a string of non-blank characters separated from adjacent fields | | 71 | A field is a string of non-blank characters separated from adjacent fields |
72 | by blanks. | | 72 | by blanks. |
73 | Field numbers are one based, i.e. the first field is field one. | | 73 | Field numbers are one based, i.e., the first field is field one. |
74 | .It Fl s Ar chars | | 74 | .It Fl s Ar chars |
75 | Ignore the first | | 75 | Ignore the first |
76 | .Ar chars | | 76 | .Ar chars |
77 | characters in each input line when doing comparisons. | | 77 | characters in each input line when doing comparisons. |
78 | If specified in conjunction with the | | 78 | If specified in conjunction with the |
79 | .Fl f | | 79 | .Fl f |
80 | option, the first | | 80 | option, the first |
81 | .Ar chars | | 81 | .Ar chars |
82 | characters after the first | | 82 | characters after the first |
83 | .Ar fields | | 83 | .Ar fields |
84 | fields will be ignored. | | 84 | fields will be ignored. |
85 | Character numbers are one based, i.e. the first character is character one. | | 85 | Character numbers are one based, i.e., the first character is character one. |
86 | .It Fl u | | 86 | .It Fl u |
87 | Don't output lines that are repeated in the input. | | 87 | Don't output lines that are repeated in the input. |
88 | .\".It Fl Ns Ar n | | 88 | .\".It Fl Ns Ar n |
89 | .\"(Deprecated; replaced by | | 89 | .\"(Deprecated; replaced by |
90 | .\".Fl f ) . | | 90 | .\".Fl f ) . |
91 | .\"Ignore the first n | | 91 | .\"Ignore the first n |
92 | .\"fields on each input line when doing comparisons, | | 92 | .\"fields on each input line when doing comparisons, |
93 | .\"where n is a number. | | 93 | .\"where n is a number. |
94 | .\"A field is a string of non-blank | | 94 | .\"A field is a string of non-blank |
95 | .\"characters separated from adjacent fields | | 95 | .\"characters separated from adjacent fields |
96 | .\"by blanks. | | 96 | .\"by blanks. |
97 | .\".It Cm \&\(pl Ns Ar n | | 97 | .\".It Cm \&\(pl Ns Ar n |
98 | .\"(Deprecated; replaced by | | 98 | .\"(Deprecated; replaced by |
99 | .\".Fl s ) . | | 99 | .\".Fl s ) . |
100 | .\"Ignore the first | | 100 | .\"Ignore the first |
101 | .\".Ar m | | 101 | .\".Ar m |
102 | .\"characters when doing comparisons, where | | 102 | .\"characters when doing comparisons, where |
103 | .\".Ar m | | 103 | .\".Ar m |
104 | .\"is a | | 104 | .\"is a |
105 | .\"number. | | 105 | .\"number. |
106 | .El | | 106 | .El |
107 | .Pp | | 107 | .Pp |
108 | If additional arguments are specified on the command line, the first | | 108 | Additional arguments |
109 | such argument is used as the name of an input file, the second is used | | 109 | .Ar input_file |
110 | as the name of an output file. | | 110 | and |
111 | .Pp | | 111 | .Ar output_file |
112 | The | | 112 | may be specified on the command line, |
113 | .Nm | | 113 | where the former is then used as the name of an input file, |
114 | utility exits 0 on success, and \*[Gt]0 if an error occurs. | | 114 | and the latter as the name of an output file. |
| | | 115 | .Sh EXIT STATUS |
| | | 116 | .Ex -std |
115 | .Sh COMPATIBILITY | | 117 | .Sh COMPATIBILITY |
116 | The historic | | 118 | The historic |
117 | .Cm \&\(pl Ns Ar number | | 119 | .Cm \&\(pl Ns Ar number |
118 | and | | 120 | and |
119 | .Fl Ns Ar number | | 121 | .Fl Ns Ar number |
120 | options have been deprecated but are still supported in this implementation. | | 122 | options have been deprecated but are still supported in this implementation. |
121 | .Sh SEE ALSO | | 123 | .Sh SEE ALSO |
122 | .Xr sort 1 | | 124 | .Xr sort 1 |
123 | .Sh STANDARDS | | 125 | .Sh STANDARDS |
124 | The | | 126 | The |
125 | .Nm | | 127 | .Nm |
126 | utility is expected to be | | 128 | utility is expected to be |
127 | .St -p1003.2 | | 129 | .St -p1003.2 |