summaryrefslogtreecommitdiff
path: root/stdout-and-$3/all.do
blob: 767863ef946a61da6d1541bbbe954f24c37988b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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'