aboutsummaryrefslogtreecommitdiff
path: root/bin/sh/tests/builtins/read2.0
blob: da7c48553ab0a1936eed9b1cfabe0ec704d27951 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30

set -e
{
	echo 1
	echo two
	echo three
} | {
	read x
	[ "$x" = 1 ]
	(read x
	[ "$x" = two ])
	read x
	[ "$x" = three ]
}

T=`mktemp sh-test.XXXXXX`
trap 'rm -f "$T"' 0
{
	echo 1
	echo two
	echo three
} >$T
{
	read x
	[ "$x" = 1 ]
	(read x
	[ "$x" = two ])
	read x
	[ "$x" = three ]
} <$T