]> git.ipfire.org Git - thirdparty/bash.git/blame - tests/redir.right
Bash-4.3 patch 7
[thirdparty/bash.git] / tests / redir.right
CommitLineData
d166f048 1abc
3185942a 2./redir.tests: line 15: /tmp/redir-test: cannot overwrite existing file
d166f048
JA
3abc
4def
5def
3185942a 6./redir.tests: line 31: $z: ambiguous redirect
d166f048
JA
7Point 1
8Point 2
9to a
10to b
11Point 3
12to a
13to a
14to b
15to b
16Point 4
17to c
18Point 5
19this is redir1.sub
20this is redir2.sub
21read line1 "ab"
22read line2 "root"
23read line3 "cd"
24read line4 "daemon"
25from stdin: aa
26to stdout
7117c2d2
JA
27./redir4.sub: line 32: $fd: ambiguous redirect
28./redir4.sub: line 33: $fd: ambiguous redirect
d166f048
JA
29/tmp/err-and-out:
30to stdout
31to stderr
32/tmp/err-and-out:
33to stdout
34to stderr
350 -- 3 0
360 -- 4 0
37ab
38cd
39ef
40gh
41ij
42kl
430
44ab
45cd
46cd
3185942a 47./redir.tests: line 154: redir1.*: No such file or directory
7117c2d2
JA
48# tests of ksh93-like dup-and-close redirection operators
49exec 9<$0
50
51f()
52{
53exec 5<$0
54
55exec 0<&5-
56
57while read line; do
58echo "$line"
59done
60}
61
62f
63
64typeset -f f
65
66# make sure it was closed
67read -u 5 foo
68echo after read
69
70exec 5<&0
71
72exec <&-
73
74read abcde
75
76exec 0<&9-
77read line
78echo $line
79f ()
80{
0628567a 81 exec 5< $0;
7117c2d2
JA
82 exec 0<&5-;
83 while read line; do
84 echo "$line";
85 done
86}
87./redir5.sub: line 20: read: 5: invalid file descriptor: Bad file descriptor
88after read
89./redir5.sub: line 27: read: read error: 0: Bad file descriptor
90# tests of ksh93-like dup-and-close redirection operators
b80f6443
JA
91/
92/
93/
940
950
960
95732b49
JA
97before block
98after block
99c1 is 1
100c2 is 2
101c3 is 3
102c4 is 4
3185942a
JA
103fd 10
104fd 8
105fd 10
106fd 8
1071
1082
1093
1104
1111
1122
1133
1144
115cat /tmp/foo
116whatsis
117hey
118to stdout
119to stderr
120
121to stdout
122to stderr
123
124to stderr
125to stdout
126
127to stderr
128hey
129to stdout
130logfunc is a function
131logfunc ()
132{
ac50fbac 133 echo "$@" &>> $TMPDIR/log
3185942a
JA
134}
135foo
136bix is a function
137bix ()
138{
139 echo foo 2>&1 | cat
140}
141foo
ac50fbac 142::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::