xref: /freebsd/bin/sh/tests/builtins/read2.0 (revision e6bfd18d21b225af6a0ed67ceeaf1293b7b9eba5)
1# $FreeBSD$
2
3set -e
4{
5	echo 1
6	echo two
7	echo three
8} | {
9	read x
10	[ "$x" = 1 ]
11	(read x
12	[ "$x" = two ])
13	read x
14	[ "$x" = three ]
15}
16
17T=`mktemp sh-test.XXXXXX`
18trap 'rm -f "$T"' 0
19{
20	echo 1
21	echo two
22	echo three
23} >$T
24{
25	read x
26	[ "$x" = 1 ]
27	(read x
28	[ "$x" = two ])
29	read x
30	[ "$x" = three ]
31} <$T
32