aboutsummaryrefslogtreecommitdiffstats
path: root/doc/gawk.1
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2011-04-18 10:23:54 +0300
committerArnold D. Robbins <arnold@skeeve.com>2011-04-18 10:23:54 +0300
commitbcb8bd6d6671a3400c4bfe3e34eb4d5d66050f32 (patch)
tree41cf2343944c2836150422b1bafabdaa73ff32bb /doc/gawk.1
parent98eb78c2d05870952fe25bbe37b86df2017f42fc (diff)
downloadegawk-bcb8bd6d6671a3400c4bfe3e34eb4d5d66050f32.tar.gz
egawk-bcb8bd6d6671a3400c4bfe3e34eb4d5d66050f32.tar.bz2
egawk-bcb8bd6d6671a3400c4bfe3e34eb4d5d66050f32.zip
More array sorting changes from John.
Diffstat (limited to 'doc/gawk.1')
-rw-r--r--doc/gawk.123
1 files changed, 18 insertions, 5 deletions
diff --git a/doc/gawk.1 b/doc/gawk.1
index bac3176d..629899b1 100644
--- a/doc/gawk.1
+++ b/doc/gawk.1
@@ -1089,10 +1089,12 @@ loops.
Supported values are
\fB"ascending index string"\fR,
\fB"ascending index number"\fR,
-\fB"ascending value"\fR,
+\fB"ascending value string"\fR,
+\fB"ascending value number"\fR,
\fB"descending index string"\fR,
\fB"descending index number"\fR,
-\fB"descending value"\fR, and
+\fB"descending value string"\fR,
+\fB"descending value number"\fR, and
\fB"unsorted"\fR.
The order specification words can be truncated, or omitted (provided
that at least one is present), or given in any order.
@@ -2439,7 +2441,7 @@ number generator.
has the following built-in string functions:
.PP
.TP "\w'\fBsprintf(\^\fIfmt\fB\^, \fIexpr-list\^\fB)\fR'u+1n"
-\fBasort(\fIs \fR[\fB, \fId\fR]\fB)\fR
+\fBasort(\fIs \fR[\fB, \fId\fR [\fB, \fIhow\fR] ]\fB)\fR
Return the number of elements in the source
array
.IR s .
@@ -2466,9 +2468,15 @@ and then sort
leaving the indices of the
source array
.I s
-unchanged.
+unchanged. The optional string
+.I how
+controls the direction and the comparsion mode.
+Valid values for
+.I how
+are "ascending string", "ascending number",
+"descending string" and "descending number".
.TP "\w'\fBsprintf(\^\fIfmt\fB\^, \fIexpr-list\^\fB)\fR'u+1n"
-\fBasorti(\fIs \fR[\fB, \fId\fR]\fB)\fR
+\fBasorti(\fIs \fR[\fB, \fId\fR [\fB, \fIhow\fR] ]\fB)\fR
Return the number of elements in the source
array
.IR s .
@@ -2481,6 +2489,11 @@ 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.
+The purpose of the optional string
+.I how
+is the same as described in
+.BR asort()
+above.
.TP
\fBgensub(\fIr\fB, \fIs\fB, \fIh \fR[\fB, \fIt\fR]\fB)\fR
Search the target string