]> git.ipfire.org Git - thirdparty/bash.git/blame - tests/varenv2.sub
bash-5.1 distribution sources and documentation
[thirdparty/bash.git] / tests / varenv2.sub
CommitLineData
8868edaf
CR
1# This program is free software: you can redistribute it and/or modify
2# it under the terms of the GNU General Public License as published by
3# the Free Software Foundation, either version 3 of the License, or
4# (at your option) any later version.
5#
6# This program is distributed in the hope that it will be useful,
7# but WITHOUT ANY WARRANTY; without even the implied warranty of
8# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9# GNU General Public License for more details.
10#
11# You should have received a copy of the GNU General Public License
12# along with this program. If not, see <http://www.gnu.org/licenses/>.
13#
7117c2d2
JA
14fff()
15{
16 typeset i=0 x=10
17 echo "|$i|$x|"
18 export x
19 printenv x
20}
21
22fff2()
23{
24 echo "|$x|"
25 export x
26 printenv x
27}
28
29fff3()
30{
31 typeset i=0 x="${x-10}"
32 echo "|$i|$x|"
33}
34
35fff4()
36{
37 typeset i=0 x
38 x="${x-10}"
39 echo "|$i|$x|"
40}
41
42fff5()
43{
44 z=y typeset z
45 echo "|$z|"
46}
47
48fff
49x=10 fff
50x=1 fff
51x=4 fff2
52x=11 fff3
53echo after fff3: x=$x
54x=12 fff4
55
56fff5
57z=42 fff5