From de23ab7bfbea6ee03ef7386c6c203a4b2b7b7116 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sat, 23 Jul 2016 22:10:25 +0300 Subject: Make return status of close on a pipe like system. --- test/status-close.awk | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 test/status-close.awk (limited to 'test/status-close.awk') diff --git a/test/status-close.awk b/test/status-close.awk new file mode 100644 index 00000000..345bea49 --- /dev/null +++ b/test/status-close.awk @@ -0,0 +1,14 @@ +BEGIN { + cat = "cat ; exit 3" + print system("echo xxx | (cat ; exit 4)") + + print "YYY" | cat + + print close(cat) + + echo = "echo boo ; exit 5" + echo | getline boo + print "got", boo + + print close(echo) +} -- cgit v1.2.3