summary refs log tree commit diff
path: root/bin/1sh/tests/builtins/read2.0
blob: 3747f0bff73989421fab675002b2490d61f8530d (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
31
# $FreeBSD: releng/12.1/bin/sh/tests/builtins/read2.0 212187 2010-09-03 21:17:33Z jilles $

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