]> git.ipfire.org Git - thirdparty/bash.git/blame - tests/vredir.right
Bash-4.4 patch 19
[thirdparty/bash.git] / tests / vredir.right
CommitLineData
495aee44
CR
110
2foo 1
3foo 2
4foo 3
5bar is a function
6bar ()
7{
8 exec {v}> $TMPFILE;
9 echo $v
10}
11./vredir.tests: line 6: v: readonly variable
12./vredir.tests: line 6: v: cannot assign fd to variable
1342
14./vredir.tests: line 25: $v: Bad file descriptor
15./vredir.tests: line 26: $v: Bad file descriptor
16./vredir.tests: line 27: $v: Bad file descriptor
17bar is a function
18bar ()
19{
20 exec {v}> $TMPFILE;
21 echo $v
22}
ac50fbac 2310
495aee44
CR
24line 1
25line 2
26line 3
27bar is a function
28bar ()
29{
30 exec {v}<<EOF
31line 1
32line 2
33line 3
34EOF
35
36 echo $v
37}
ac50fbac 3810
495aee44
CR
39foo 1
40foo 2
41foo 3
ac50fbac 4210
495aee44
CR
43/bin/bash
44/bin/csh
45/bin/ksh
46/bin/sh
47/bin/tcsh
48/bin/zsh
49oclosev is a function
50oclosev ()
51{
52 exec {v}>&-
53}
54iclosev is a function
55iclosev ()
56{
57 exec {v}>&-
58}
59/bin/bash
60/bin/csh
61/bin/ksh
62/bin/sh
63/bin/tcsh
64/bin/zsh
65./vredir3.sub: line 4: v: ambiguous redirect
66after
ac50fbac 6710 11
495aee44
CR
68a
69a
70swizzle is a function
71swizzle ()
72{
73 fd0=0;
74 fd1=1;
75 exec {stdin}<&$fd0;
76 exec {stdout}>&$fd1
77}
ac50fbac 7812 10
495aee44
CR
79a
80a
81swizzle is a function
82swizzle ()
83{
84 exec {fd0}<&0;
85 exec {fd1}>&1;
86 exec {stdin}<&$fd0-;
87 exec {stdout}>&$fd1-
88}
89ok 1
90./vredir6.sub: redirection error: cannot duplicate fd: Invalid argument
a0c0a00f 91./vredir6.sub: line 13: /dev/null: Invalid argument
495aee44 92unset
a0c0a00f
CR
9312 10
94a
95a
96swizzle is a function
97swizzle ()
98{
99 exec {fd[0]}<&0;
100 exec {fd[1]}>&1;
101 exec {stdin}<&${fd[0]}-;
102 exec {stdout}>&${fd[1]}-
103}