freebsd-skq/contrib/awk/test/clos1way.awk
2001-11-02 21:06:08 +00:00

22 lines
405 B
Awk

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)
}