source: vendor/bash/3.1-p17/tests/func1.sub

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

bash 3.1

File size: 638 bytes
Line 
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'
Note: See TracBrowser for help on using the repository browser.