aboutsummaryrefslogtreecommitdiffstats
path: root/test/clos1way.awk
diff options
context:
space:
mode:
Diffstat (limited to 'test/clos1way.awk')
-rw-r--r--test/clos1way.awk21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/clos1way.awk b/test/clos1way.awk
new file mode 100644
index 00000000..5bc40684
--- /dev/null
+++ b/test/clos1way.awk
@@ -0,0 +1,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)
+}