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.
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.
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/>.
14 # this shows the expansions an array subscript undergoes before being run
15 # through the arithmetic evaluator
19 # array subscripts undergo variable expansion
23 # array subscripts undergo command substitution
29 # array subscripts are expanded and the expanded value is treated as an
37 # array subscripts undergo parameter expansion
41 # array subscripts undergo tilde expansion
45 # array subscripts undergo word splitting -- bug in bush versions through 4.3
59 # start of quoting tests; make sure that subscript is treated as double
60 # quoted (inhibits word splitting) but that double quotes are silently
61 # discarded through quote removal
70 a=(zero one two three four five six seven eight nine ten)
85 # tilde expansion is performed by array subscript expansion but not by posix
86 # style arithmetic expansion