summaryrefslogtreecommitdiff
path: root/test/clos1way.awk
blob: 5bc4068482b00d42827b53ac6d2c94f0c082b026 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
BEGIN {
	command = "LC_ALL=C sort"

	n = split("abcdefghijklmnopqrstuvwxyz", a, "")
	for (i = n; i > 0; i--) {
#		print "printing", a[i] > "/dev/stderr"
		print a[i] |& command
	}

	close(command, "to")

#	print "starting read loop" > "/dev/stderr"
	do {
		if (line)
			print "got", line
#		stopme();
	} while ((command |& getline line) > 0)

#	print "doing final close" > "/dev/stderr"
	close(command)
}