aboutsummaryrefslogtreecommitdiffstats
path: root/doc/gawk.1
diff options
context:
space:
mode:
Diffstat (limited to 'doc/gawk.1')
-rw-r--r--doc/gawk.149
1 files changed, 42 insertions, 7 deletions
diff --git a/doc/gawk.1 b/doc/gawk.1
index 5f73a68e..40dd3030 100644
--- a/doc/gawk.1
+++ b/doc/gawk.1
@@ -14,7 +14,7 @@
. if \w'\(rq' .ds rq "\(rq
. \}
.\}
-.TH GAWK 1 "Apr 16 2002" "Free Software Foundation" "Utility Commands"
+.TH GAWK 1 "February 3 2003" "Free Software Foundation" "Utility Commands"
.SH NAME
gawk \- pattern scanning and processing language
.SH SYNOPSIS
@@ -265,10 +265,10 @@ the standard output.
these options cause an immediate, successful exit.)
.TP
.PD 0
-.BR "\-W lint" [ =fatal ]
+.BR "\-W lint" [ =\fIvalue\fR ]
.TP
.PD
-.BR \-\^\-lint [ =fatal ]
+.BR \-\^\-lint [ =\fIvalue\fR ]
Provide warnings about constructs that are
dubious or non-portable to other \*(AK implementations.
With an optional argument of
@@ -276,6 +276,10 @@ With an optional argument of
lint warnings become fatal errors.
This may be drastic, but its use will certainly encourage the
development of cleaner \*(AK programs.
+With an optional argument of
+.BR invalid ,
+only warnings about things that are
+actually invalid are issued. (This is not fully implemented yet.)
.TP
.PD 0
.B "\-W lint\-old"
@@ -812,9 +816,12 @@ operations.
.B NOTE:
Array subscripting is
.I not
-affected, nor is the
+affected.
+However, the
.B asort()
-function.
+and
+.B asorti()
+functions are affected.
.sp .5
Thus, if
.B IGNORECASE
@@ -2236,6 +2243,20 @@ is sorted, leaving the indexes of the
source array
.I s
unchanged.
+.TP "\w'\fBsprintf(\^\fIfmt\fB\^, \fIexpr-list\^\fB)\fR'u+1n"
+\fBasorti(\fIs \fR[\fB, \fId\fR]\fB)\fR
+Returns the number of elements in the source
+array
+.IR s .
+The behavior is the same as that of
+.BR asort() ,
+except that the array
+.I indices
+are used for sorting, not the array values.
+When done, the array is indexed numerically, and
+the values are those of the original indices.
+The original values are lost; thus provide
+a second array if you wish to preserve the original.
.TP
\fBgensub(\fIr\fB, \fIs\fB, \fIh \fR[\fB, \fIt\fR]\fB)\fR
Search the target string
@@ -2367,6 +2388,12 @@ of
.I s
matched by the entire regular expression
.IR r .
+Subscripts
+\fBa[\fIn\^\fB, "start"]\fR,
+and
+\fBa[\fIn\^\fB, "length"]\fR
+provide the starting index in the string and length
+respectively, of each matching substring.
.TP
\fBsplit(\fIs\fB, \fIa \fR[\fB, \fIr\fR]\fB)\fR
Splits the string
@@ -2459,7 +2486,7 @@ formatting them.
.PP
.TP "\w'\fBsystime()\fR'u+1n"
\fBmktime(\fIdatespec\fB)\fR
-Rurns
+Turns
.I datespec
into a time stamp of the same form as returned by
.BR systime() .
@@ -2782,6 +2809,12 @@ Concatenate and line number (a variation on a theme):
.ft B
{ print NR, $0 }
.ft R
+Run an external command for particular lines of data:
+
+.ft B
+ tail -f access_log |
+ awk '/myhome.html/ { system("nmap " $1 ">> logdir/myhome.html") }'
+.ft R
.fi
.SH INTERNATIONALIZATION
.PP
@@ -3117,9 +3150,11 @@ to abandon processing of the current input file.
The
.BR and() ,
.BR asort() ,
+.BR asorti() ,
.BR bindtextdomain() ,
.BR compl() ,
.BR dcgettext() ,
+.BR dcngettext() ,
.BR gensub() ,
.BR lshift() ,
.BR mktime() ,
@@ -3321,7 +3356,7 @@ provided valuable assistance during testing and debugging.
We thank him.
.SH COPYING PERMISSIONS
Copyright \(co 1989, 1991, 1992, 1993, 1994, 1995, 1996,
-1997, 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+1997, 1998, 1999, 2001, 2002, 2003 Free Software Foundation, Inc.
.PP
Permission is granted to make and distribute verbatim copies of
this manual page provided the copyright notice and this permission