source: trunk/essentials/app-shells/bash/tests/redir.right

Last change on this file was 3228, checked in by bird, 18 years ago

bash 3.1

File size: 1.2 KB
Line 
1abc
2./redir.tests: line 13: /tmp/redir-test: cannot overwrite existing file
3abc
4def
5def
6./redir.tests: line 29: $z: ambiguous redirect
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
27./redir4.sub: line 32: $fd: ambiguous redirect
28./redir4.sub: line 33: $fd: ambiguous redirect
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
47./redir.tests: line 152: redir1.*: No such file or directory
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{
81 exec 5<$0;
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
91/
92/
93/
940
950
960
97before block
98after block
99c1 is 1
100c2 is 2
101c3 is 3
102c4 is 4
Note: See TracBrowser for help on using the repository browser.