]> git.ipfire.org Git - thirdparty/bash.git/blame - tests/vredir2.sub
Bash-4.2 patch 14
[thirdparty/bash.git] / tests / vredir2.sub
CommitLineData
495aee44
CR
1: ${TMPDIR:=/var/tmp}
2SHELLSFILE=$TMPDIR/shells-$$
3
4cat > $TMPDIR/shells-$$ <<EOF
5/bin/bash
6/bin/csh
7/bin/ksh
8/bin/sh
9/bin/tcsh
10/bin/zsh
11EOF
12
13oclosev()
14{
15exec {v}>&-
16}
17
18iclosev()
19{
20exec {v}<&-
21}
22
23exec {v}>&1
24echo $v
25
26echo foo 1 >&$v
27echo foo 2 >&$v
28echo foo 3 >&$v
29
30oclosev
31
32exec {v}<$SHELLSFILE
33echo $v
34
35while read line <&$v
36do
37 echo $line
38done
39
40iclosev
41
42type oclosev
43type iclosev
44
45while read -r -u ${fd}
46do
47 echo $REPLY
48done {fd}<$SHELLSFILE
49
50rm -f $SHELLSFILE
51
52exit 0