uniq: Fixup program usage and manpage
Remove -i as it is not required by POSIX. We'll add it if we hit scripts that require it.
This commit is contained in:
parent
5836ef72e3
commit
5f06185b1b
2
README
2
README
|
@ -79,7 +79,7 @@ The following tools are implemented ('*' == finished, '#' == UTF-8 support,
|
||||||
=* tty yes none
|
=* tty yes none
|
||||||
=* uname yes none
|
=* uname yes none
|
||||||
#* unexpand yes none
|
#* unexpand yes none
|
||||||
= uniq no none
|
= uniq no [infile [outfile]]
|
||||||
=* unlink yes none
|
=* unlink yes none
|
||||||
= uudecode no -o
|
= uudecode no -o
|
||||||
= uuencode no -m
|
= uuencode no -m
|
||||||
|
|
29
uniq.1
29
uniq.1
|
@ -6,7 +6,10 @@
|
||||||
.Nd report or filter out repeated lines in a file
|
.Nd report or filter out repeated lines in a file
|
||||||
.Sh SYNOPSIS
|
.Sh SYNOPSIS
|
||||||
.Nm
|
.Nm
|
||||||
.Op Fl cdu
|
.Op Fl c
|
||||||
|
.Op Fl d | u
|
||||||
|
.Op Fl f Ar fields
|
||||||
|
.Op Fl s Ar chars
|
||||||
.Op Ar file
|
.Op Ar file
|
||||||
.Sh DESCRIPTION
|
.Sh DESCRIPTION
|
||||||
.Nm
|
.Nm
|
||||||
|
@ -26,20 +29,12 @@ Prefixes each line with a count of its consecutive occurrences in the input.
|
||||||
Suppresses non-duplicate lines (thus 'uniq -d' prints only duplicates).
|
Suppresses non-duplicate lines (thus 'uniq -d' prints only duplicates).
|
||||||
.It Fl u
|
.It Fl u
|
||||||
Suppresses non-unique lines (thus 'uniq -u' prints only uniques).
|
Suppresses non-unique lines (thus 'uniq -u' prints only uniques).
|
||||||
|
.It Fl f Ar fields
|
||||||
|
Ignore the first
|
||||||
|
.Ar fields
|
||||||
|
in each input line when doing comparisons.
|
||||||
|
.It Fl s Ar chars
|
||||||
|
Ignore the first
|
||||||
|
.Ar chars
|
||||||
|
characters in each input line when doing comparisons.
|
||||||
.El
|
.El
|
||||||
.Sh BUGS
|
|
||||||
The original sbase implementation of
|
|
||||||
.Nm
|
|
||||||
supported multiple input-file arguments as e.g.
|
|
||||||
.Xr cat 1
|
|
||||||
and
|
|
||||||
.Xr grep 1
|
|
||||||
do.
|
|
||||||
Unfortunately, POSIX uniq treats its second argument (if present) as an
|
|
||||||
output filename and clobbers it. Since users and scripts which rely on
|
|
||||||
.Nm
|
|
||||||
supporting multiple input-file arguments would be at risk of data loss
|
|
||||||
if they ever ran into a POSIX-compatible
|
|
||||||
.Nm
|
|
||||||
, support for multiple input-file arguments was removed from this
|
|
||||||
implementation.
|
|
||||||
|
|
4
uniq.c
4
uniq.c
|
@ -25,7 +25,7 @@ static long prevlinecount = 0;
|
||||||
static void
|
static void
|
||||||
usage(void)
|
usage(void)
|
||||||
{
|
{
|
||||||
eprintf("usage: %s [-cdiu] [input]]\n", argv0);
|
eprintf("usage: %s [-cdufs] [file]\n", argv0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -34,8 +34,6 @@ main(int argc, char *argv[])
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
|
|
||||||
ARGBEGIN {
|
ARGBEGIN {
|
||||||
case 'i':
|
|
||||||
eprintf("not implemented\n");
|
|
||||||
case 'c':
|
case 'c':
|
||||||
countfmt = "%7ld ";
|
countfmt = "%7ld ";
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user