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