diff options
-rw-r--r-- | test/ChangeLog | 9 | ||||
-rw-r--r-- | test/clos1way2.awk | 3 | ||||
-rw-r--r-- | test/clos1way2.ok | 2 | ||||
-rw-r--r-- | test/clos1way3.awk | 3 | ||||
-rw-r--r-- | test/clos1way4.awk | 3 | ||||
-rw-r--r-- | test/clos1way5.awk | 3 |
6 files changed, 18 insertions, 5 deletions
diff --git a/test/ChangeLog b/test/ChangeLog index 59e26897..d45091aa 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,12 @@ +2016-04-08 Eli Zaretskii <eliz@gnu.org> + + * clos1way2.awk: + * clos1way3.awk: + * clos1way4.awk: + * clos1way5.awk: Use "&&" instead of ";" to chain commands, so + that it works with stock MS-Windows shells as well. + * clos1way2.ok: Adjust the error message to the change in command. + 2016-04-08 Arnold D. Robbins <arnold@skeeve.com> * watchpoint1: Use $(srcdir) on input file so out-of-tree diff --git a/test/clos1way2.awk b/test/clos1way2.awk index 5794bec5..c734c142 100644 --- a/test/clos1way2.awk +++ b/test/clos1way2.awk @@ -1,5 +1,6 @@ { - cmd = "cat - 1>&2; sleep 2" + # We use "&&" and not ";" so it works with Windows shells as well. + cmd = "cat - 1>&2 && sleep 2" print |& cmd; close(cmd, "to") fflush(cmd) print |& cmd; print ERRNO diff --git a/test/clos1way2.ok b/test/clos1way2.ok index 67240ac9..f6d7bcd7 100644 --- a/test/clos1way2.ok +++ b/test/clos1way2.ok @@ -1,4 +1,4 @@ -gawk: clos1way2.awk:4: (FILENAME=- FNR=1) warning: fflush: cannot flush: two-way pipe `cat - 1>&2; sleep 2' has closed write end +gawk: clos1way2.awk:4: (FILENAME=- FNR=1) warning: fflush: cannot flush: two-way pipe `cat - 1>&2 && sleep 2' has closed write end test gawk: clos1way2.awk:5: (FILENAME=- FNR=1) fatal: print: attempt to write to closed write end of two-way pipe EXIT CODE: 2 diff --git a/test/clos1way3.awk b/test/clos1way3.awk index f69f6675..2c4a6f4f 100644 --- a/test/clos1way3.awk +++ b/test/clos1way3.awk @@ -1,5 +1,6 @@ BEGIN { - cmd = "cat - 1>&2; sleep 2" + # We use "&&" and not ";" so it works with Windows shells as well. + cmd = "cat - 1>&2 && sleep 2" print "test1" |& cmd close(cmd, "to") print "test2" |& cmd diff --git a/test/clos1way4.awk b/test/clos1way4.awk index 6c68c5c8..106e4467 100644 --- a/test/clos1way4.awk +++ b/test/clos1way4.awk @@ -1,5 +1,6 @@ BEGIN { - cmd = "cat - 1>&2; sleep 2" + # We use "&&" and not ";" so it works with Windows shells as well. + cmd = "cat - 1>&2 && sleep 2" printf "%s\n", "test1" |& cmd close(cmd, "to") printf "%s\n", "test2" |& cmd diff --git a/test/clos1way5.awk b/test/clos1way5.awk index ca1bd94c..0af19093 100644 --- a/test/clos1way5.awk +++ b/test/clos1way5.awk @@ -1,5 +1,6 @@ BEGIN { - cmd = "echo test1; echo test2; sleep 2" + # We use "&&" and not ";" so it works with Windows shells as well. + cmd = "echo test1&& echo test2&& sleep 2" cmd |& getline x print x close(cmd, "from") |