summaryrefslogtreecommitdiffstats
path: root/usr.bin/wc/wc.1
diff options
context:
space:
mode:
authorkeramida <keramida@FreeBSD.org>2008-12-06 19:21:56 +0000
committerkeramida <keramida@FreeBSD.org>2008-12-06 19:21:56 +0000
commite50dcd29223a660dbc3857b80b62aa779bb8f068 (patch)
tree399ce883a1fce7b698e98c169c202d48a1d0ed70 /usr.bin/wc/wc.1
parenta72e17aca8ca75aa7be4efd0b81d0993fe572313 (diff)
downloadFreeBSD-src-e50dcd29223a660dbc3857b80b62aa779bb8f068.zip
FreeBSD-src-e50dcd29223a660dbc3857b80b62aa779bb8f068.tar.gz
Add a -L option to wc(1), for finger compatibility with the GNU
wc utility. The -L option can be used to report the length of the longest line wc has seen in one or more files. It is disabled by default, and wc uses the standard `-lwc'. Submitted by: Sheldon Givens, sheldon at sigsegv.ca Reviewed by: kib MFC after: 1 week
Diffstat (limited to 'usr.bin/wc/wc.1')
-rw-r--r--usr.bin/wc/wc.127
1 files changed, 25 insertions, 2 deletions
diff --git a/usr.bin/wc/wc.1 b/usr.bin/wc/wc.1
index eeaaa74..2e8ac2d 100644
--- a/usr.bin/wc/wc.1
+++ b/usr.bin/wc/wc.1
@@ -35,7 +35,7 @@
.\" @(#)wc.1 8.2 (Berkeley) 4/19/94
.\" $FreeBSD$
.\"
-.Dd February 23, 2005
+.Dd December 6, 2008
.Dt WC 1
.Os
.Sh NAME
@@ -43,7 +43,7 @@
.Nd word, line, character, and byte count
.Sh SYNOPSIS
.Nm
-.Op Fl clmw
+.Op Fl Lclmw
.Op Ar
.Sh DESCRIPTION
The
@@ -71,6 +71,15 @@ the last file.
.Pp
The following options are available:
.Bl -tag -width indent
+.It Fl L
+The number of characters in the longest input line
+is written to the standard output.
+When more then one
+.Ar file
+argument is specified, the longest input line of
+.Em all
+files is reported as the value of the final
+.Dq total .
.It Fl c
The number of bytes in each input file
is written to the standard output.
@@ -129,6 +138,10 @@ and
as well as the totals for both:
.Pp
.Dl "wc -mlw report1 report2"
+.Pp
+Find the longest line in a list of files:
+.Pp
+.Dl "wc -L file1 file2 file3 | fgrep total"
.Sh COMPATIBILITY
Historically, the
.Nm
@@ -154,6 +167,16 @@ in terms of the
.Xr iswspace 3
function, as required by
.St -p1003.2 .
+.Pp
+The
+.Fl L
+option is a non-standard
+.Fx
+extension, compatible with the
+.Fl L
+option of the GNU
+.Nm
+utility.
.Sh SEE ALSO
.Xr iswspace 3
.Sh STANDARDS
OpenPOWER on IntegriCloud