summaryrefslogtreecommitdiff
path: root/test/asort.awk
blob: 8a42e26ab6f1247959da4d98c3b6aa550458eced (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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 "============"
	}
}