aboutsummaryrefslogtreecommitdiffstats
path: root/test/getline.awk
diff options
context:
space:
mode:
Diffstat (limited to 'test/getline.awk')
-rw-r--r--test/getline.awk30
1 files changed, 29 insertions, 1 deletions
diff --git a/test/getline.awk b/test/getline.awk
index f4e413f9..fc09f789 100644
--- a/test/getline.awk
+++ b/test/getline.awk
@@ -1 +1,29 @@
-BEGIN { while( getline > 0) { print } }
+BEGIN {
+ x = y = "s"
+ a = (getline x y)
+ print a, x
+ a = (getline x + 1)
+ print a, x
+ a = (getline x - 2)
+ print a, x
+
+ cmd = "echo A"
+ a = (cmd | getline x y)
+ close(cmd)
+ print a, x
+
+ cmd = "echo B"
+ a = (cmd | getline x + 1)
+ close(cmd)
+ print a, x
+
+ cmd = "echo C"
+ a = (cmd | getline x - 2)
+ close(cmd)
+ print a, x
+
+ cmd = "echo D"
+ a = cmd | getline x
+ close(cmd)
+ print a, x
+}