Ticket #36682: test
File test, 398 bytes (added by ajdudman, 9 years ago) |
---|
Line | |
---|---|
1 | #!/bin/ksh |
2 | |
3 | |
4 | shells=' |
5 | /bin/ksh |
6 | /opt/local/bin/ksh |
7 | /opt/local/bin/ksh93u+ |
8 | /opt/local/bin/ksh93v- |
9 | /opt/ast/bin/ksh |
10 | /opt/ast/bin/bash |
11 | /bin/bash |
12 | ' |
13 | |
14 | |
15 | for s in $shells; do |
16 | [[ -x $s ]] || continue |
17 | echo $s |
18 | $s -s <<-\EOF |
19 | echo ${.sh.version} |
20 | a=0 |
21 | function f { |
22 | typeset a=1 |
23 | echo $a |
24 | } |
25 | g() { |
26 | typeset a=2 |
27 | echo $a |
28 | } |
29 | echo $a |
30 | f |
31 | echo $a |
32 | g |
33 | echo $a |
34 | EOF |
35 | echo |
36 | done |
37 | |
38 | sw_vers |
39 | |
40 | |
41 | exit 0 |