summaryrefslogtreecommitdiff
path: root/stdout-and-$3
diff options
context:
space:
mode:
Diffstat (limited to 'stdout-and-$3')
-rw-r--r--stdout-and-$3/all.do14
-rw-r--r--stdout-and-$3/param3.do2
-rw-r--r--stdout-and-$3/stdout.do2
3 files changed, 18 insertions, 0 deletions
diff --git a/stdout-and-$3/all.do b/stdout-and-$3/all.do
index a6d65eb..767863e 100644
--- a/stdout-and-$3/all.do
+++ b/stdout-and-$3/all.do
@@ -1,4 +1,18 @@
#!/bin/sh
+[ -e stdout ] && rm stdout
+redo-ifchange stdout
+read -r STDOUT <stdout
+[ "${STDOUT}" = "stdout" ] \
+ && printf >&2 'PASS: Write to stdout possible.\n' \
+ || printf >&2 'FAIL: Write to stdout impossible.\n'
+
+[ -e param3 ] && rm param3
+redo-ifchange param3
+read -r PARAM3 <param3
+[ "${PARAM3}" = "param3" ] \
+ && printf >&2 'PASS: Write to $3 possible.\n' \
+ || printf >&2 'FAIL: Write to $3 impossible.\n'
+
redo-ifchange bogus \
&& printf >&2 'FAIL: Write to $3 and stdout possible.\n' \
|| printf >&2 'PASS: Write to $3 and stdout impossible.\n'
diff --git a/stdout-and-$3/param3.do b/stdout-and-$3/param3.do
new file mode 100644
index 0000000..3333254
--- /dev/null
+++ b/stdout-and-$3/param3.do
@@ -0,0 +1,2 @@
+#!/bin/sh
+printf 'param3\n' >${3}
diff --git a/stdout-and-$3/stdout.do b/stdout-and-$3/stdout.do
new file mode 100644
index 0000000..0c9c3c8
--- /dev/null
+++ b/stdout-and-$3/stdout.do
@@ -0,0 +1,2 @@
+#!/bin/sh
+printf 'stdout\n'