]> git.ipfire.org Git - thirdparty/bash.git/blame - tests/func1.sub
Bash-4.2 patch 14
[thirdparty/bash.git] / tests / func1.sub
CommitLineData
bb70624e
JA
1#
2# Test that redirections attached to shell functions are printed correctly.
3# This was a bug in all bash versions before bash-2.04.
4#
5f()
6{
7 echo f-x
8 echo f-y
9} >&2
10
11type f
12export -f f
13${THIS_SH} -c 'echo subshell; type f'
14
15f2()
16{
17 echo f2-a
18 f3()
19 {
20 echo f3-a
21 echo f3-b
22 } >&2
23 f3
24}
25
26type f2
27
28export -f f2
29${THIS_SH} -c 'echo subshell; type f2'
30
31f4()
32{
33 echo f4-a
34 f5()
35 {
36 echo f5-a
37 echo f5-b
38 } >&2
39 f5
40} 2>&1
41
42type f4
43export -f f4
44${THIS_SH} -c 'echo subshell; type f4'
45
46testgrp()
47{
48 echo testgrp-a
49 { echo tg-x; echo tg-y; } >&2
50 echo testgrp-b
51}
52type testgrp
53
54export -f testgrp
55${THIS_SH} -c 'echo subshell; type testgrp'