aboutsummaryrefslogtreecommitdiffstats
path: root/test/asort.awk
diff options
context:
space:
mode:
Diffstat (limited to 'test/asort.awk')
-rw-r--r--test/asort.awk25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/asort.awk b/test/asort.awk
new file mode 100644
index 00000000..8a42e26a
--- /dev/null
+++ b/test/asort.awk
@@ -0,0 +1,25 @@
+function init(a)
+{
+ a[1] = "aardvark"
+ a[2] = "animal"
+ a[3] = "zebra"
+ a[4] = "zoo"
+ a[5] = "Iguana"
+ a[6] = "Alligator"
+ a[7] = "Nouns"
+ a[8] = "people"
+}
+
+BEGIN {
+
+ for (IGNORECASE = 0; IGNORECASE < 2; IGNORECASE++) {
+ init(a)
+
+ n = asort(a)
+
+ for (i = 1; i <= n; i++)
+ printf("a[%d] = \"%s\"\n", i, a[i])
+
+ print "============"
+ }
+}