]> git.ipfire.org Git - thirdparty/bash.git/blame - tests/func.right
Bash-4.3 patch 7
[thirdparty/bash.git] / tests / func.right
CommitLineData
d166f048
JA
1a returns 5
2b returns 4
3c returns 3
4d returns 2
5in e
6e returned 25
7x is 25
8ZZ
9abcde
10defghi
11ZZ
125
130
14AVAR
15AVAR
16foo
17foo
18AVAR
195
205
21f1
22f1 ()
23{
24 ( return 5 );
25 status=$?;
26 echo $status;
27 return $status
28}
bb70624e 29before: try to assign to FUNCNAME
3185942a 30outside: FUNCNAME =
bb70624e
JA
31before: FUNCNAME = func
32FUNCNAME = func2
33after: FUNCNAME = func
34outside2: FUNCNAME =
35function
36zf is a function
37zf ()
38{
39 echo this is zf
40}
41f is a function
42f ()
43{
44 echo f-x;
45 echo f-y
46} 1>&2
47subshell
48f is a function
49f ()
50{
51 echo f-x;
52 echo f-y
53} 1>&2
54f2 is a function
55f2 ()
56{
57 echo f2-a;
58 function f3 ()
59 {
60 echo f3-a;
61 echo f3-b
62 } 1>&2;
63 f3
64}
65subshell
66f2 is a function
67f2 ()
68{
69 echo f2-a;
70 function f3 ()
71 {
72 echo f3-a;
73 echo f3-b
74 } 1>&2;
75 f3
76}
77f4 is a function
78f4 ()
79{
80 echo f4-a;
81 function f5 ()
82 {
83 echo f5-a;
84 echo f5-b
85 } 1>&2;
86 f5
87} 2>&1
88subshell
89f4 is a function
90f4 ()
91{
92 echo f4-a;
93 function f5 ()
94 {
95 echo f5-a;
96 echo f5-b
97 } 1>&2;
98 f5
99} 2>&1
100testgrp is a function
101testgrp ()
102{
103 echo testgrp-a;
104 {
105 echo tg-x;
106 echo tg-y
107 } 1>&2;
108 echo testgrp-b
109}
110subshell
111testgrp is a function
112testgrp ()
113{
114 echo testgrp-a;
115 {
116 echo tg-x;
117 echo tg-y
118 } 1>&2;
119 echo testgrp-b
120}
28ef6c31
JA
121funca is a function
122funca ()
123{
124 ( echo func-a )
125}
126funcb is a function
127funcb ()
128{
129 ( echo func-b )
130}
131funcc is a function
132funcc ()
133{
134 ( echo func-c ) 2>&1
135}
136func-a
137func-b
138func-c
0001803f
CR
139foo-bar
140foo-bar ()
141{
142 :
143}
28ef6c31
JA
144expect 5 10
1455 10
146expect 20
14720
148expect 5 20
1495 20
150expect 5 30
1515 30
152expect 2 40
1532 40
154expect 5 20
1555 20
495aee44
CR
156./func4.sub: line 10: foo: maximum function nesting level exceeded (100)
1571
158after: f = 100
159./func4.sub: line 10: foo: maximum function nesting level exceeded (100)
1601
161after: f = 100
1627
163after FUNCNEST reset: f = 201
1647
165after FUNCNEST unset: f = 201
166./func4.sub: line 10: foo: maximum function nesting level exceeded (20)
1671
168after FUNCNEST assign: f = 38
0628567a 1695