]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - tools/regression/bin/sh/builtins/read2.0
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / tools / regression / bin / sh / builtins / read2.0
1 # $FreeBSD$
2
3 set -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
17 T=`mktemp sh-test.XXXXXX`
18 trap '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