add POSIX/IEEE contribution notice
[unix-history] / usr / src / usr.bin / wc / wc.1
index ff268dd..b67ca21 100644 (file)
@@ -1,74 +1,88 @@
-.\" Copyright (c) 1980 Regents of the University of California.
-.\" All rights reserved.  The Berkeley software License Agreement
-.\" specifies the terms and conditions for redistribution.
+.\" Copyright (c) 1991 Regents of the University of California.
+.\" All rights reserved.
 .\"
 .\"
-.\"    @(#)wc.1        4.1 (Berkeley) %G%
+.\" This code is derived from software contributed to Berkeley by
+.\" the Institute of Electrical and Electronics Engineers, Inc.
 .\"
 .\"
-.TH WC 1 
-.UC 4
-.SH NAME
-wc \- word count
-.SH SYNOPSIS
-.B wc
-[
-.B \-lwcpt
-] [
-.BI \-b baud
-] [
-.BI \-s pagesize
-] [
-.B \-u
-] [
-.B \-v
-] [ name ... ]
-.SH DESCRIPTION
-.I Wc
-counts lines, words and characters,
-and optionally pages and the print time,
-in the named files,
-or in the standard input if no name appears.
-A word is a maximal string of characters
-delimited by spaces, tabs or newlines.
-.PP
-If an argument beginning with one of ``lwcpt'' is present,
-the specified counts (lines, words, characters, pages, or time)
-are selected by the letters
-.BR l ,
-.BR w ,
-.BR c ,
-.BR p ,
-or
-.BR t .
-The default is
-.B \-lwc
-unless
-.B \-v
-is specified.
-.PP
-The
-.B \-b
-option asks that the time be figured at
-the specified baud rate instead of the default 300 baud.
-.PP
+.\" %sccs.include.redist.man%
+.\"
+.\"     @(#)wc.1       6.4 (Berkeley) %G%
+.\"
+.Dd 
+.Dt WC 1
+.Os
+.Sh NAME
+.Nm wc
+.Nd word, line, and byte count
+.Sh SYNOPSIS
+.Nm wc
+.Op Fl clw
+.Op Ar file ...
+.Sh DESCRIPTION
 The
 The
-.B \-s
-option specifies that pages are
-.I pagesize
-lines long instead of the default 66.
-.PP
+.Nm wc
+utility reads one or more input text files, and, by
+default, writes the number of lines, words, and bytes
+contained in each input file to the standard output.
+If more than one input file is specified,
+a line of cumulative count(s) for all named files is output on a
+separate line
+following the last file count.
+.Nm Wc
+considers a word to be a maximal string of
+characters delimited by white space.
+.Pp
+The following options are available:
+.Bl -tag -width Ds
+.It Fl c
+The number of bytes in each input file
+is written to the standard output.
+.It Fl l
+The number of lines in each input file
+is written to the standard output.
+.It Fl w
+The number of words in each input file
+is written to the standard output.
+.El
+.Pp
+When an option is specified,
+.Nm wc
+only
+reports the
+information requested by that option. The
+default action is equivalent to all the
+flags
+.Fl clw
+having been specified.
+.Pp
+The following operands are available:
+.Bl -tag -width Ds
+.It Ar file
+A pathname of an input file.
+.El
+.Pp
+If no file names
+are specified, the standard input is used and
+a file name is not output. The resulting output is one
+line of the requested count(s) with the cumulative sum
+of all files read in via standard input.
+.Pp
+By default, the standard output contains a line for each
+input file of the form:
+.Bd -literal -offset indent
+lines   words  bytes   file_name
+.Ed
+.Pp
+The counts for lines, words and bytes are integers separated
+by spaces.
+The ordering of the display of the number of lines, words,
+and/or bytes is the order in which the options were specified.
+.Pp
 The
 The
-.B \-u
-options asks that the time printed be based on uucp
-transmission time, about 90% as fast as normal.
-.PP
+.Nm wc
+utility exits 0 on success, and >0 if an error occurs.
+.Sh STANDARDS
 The
 The
-.B \-v
-option asks for a verbose output format,
-with headers and including pages and time by default.
-.SH BUGS
-The times given do not take into account variable factors
-such as system load;
-delays due to tab expansion or tty driver delays,
-which can be a factor with cu;
-or uucp delays such as mail headers, auxillary protocol files, 
-or the time taken to initially connect to another site.
+.Nm wc
+function conforms to
+.St -p1003.2 .