Imported from ../bash-4.0-rc1.tar.gz.
[platform/upstream/bash.git] / tests / read2.sub
1 a=4
2
3 read -t 2 a < /dev/tty
4 estat=$?
5 if [ $estat -gt 128 ]; then
6         echo timeout 1: ok
7 else
8         echo $estat
9 fi
10
11 echo $a
12
13 sleep 5 | read -t 1 a
14 estat=$?
15 if [ $estat -gt 128 ]; then
16         echo timeout 2: ok
17 else
18         echo $estat
19 fi
20
21 echo $a
22
23 read -t -3 a < /dev/tty
24 echo $?
25
26 echo $a
27
28 # the above should all time out
29 echo abcde | {
30         read -t 2 a
31         echo $a
32 }