summaryrefslogtreecommitdiffstats
path: root/bin/sh/tests/builtins/read2.0
blob: fc7451191586194ca2f58e8433b7266405a2109f (plain)
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
31
# $FreeBSD$

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
OpenPOWER on IntegriCloud