]>
Commit | Line | Data |
---|---|---|
4491c030 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 | # | |
14 | ||
15 | # bash versions up to and including bash-5.1 expanded these subscripts more | |
16 | # than once | |
17 | ||
18 | declare -A A | |
19 | ||
20 | A["Darwin"]=darjeeling | |
21 | A['$(echo Darwin ; echo stderr>&2)']=darjeeling | |
22 | ||
23 | declare -p A | |
24 | ||
25 | echo ${A[$(echo Darwin ; echo stderr>&2)]//eel/shark} | |
26 | echo ${A['$(echo Darwin ; echo stderr>&2)']//eel/shark} | |
27 | ||
28 | echo ${A[$(echo Darwin ; echo stderr>&2)]:0:4} | |
29 | echo ${A['$(echo Darwin ; echo stderr>&2)']:0:4} | |
30 | ||
31 | echo ${A[$(echo Darwin ; echo stderr>&2)]^^} | |
32 | echo ${A['$(echo Darwin ; echo stderr>&2)']^^} | |
33 | ||
34 | echo ${A[$(echo Darwin ; echo stderr>&2)]@Q} | |
35 | echo ${A['$(echo Darwin ; echo stderr>&2)']@Q} | |
36 | ||
37 | echo ${A[$(echo Darwin ; echo stderr>&2)]%ing} | |
38 | echo ${A['$(echo Darwin ; echo stderr>&2)']%ing} | |
39 | ||
40 | echo ${#A[$(echo Darwin ; echo stderr>&2)]} | |
41 | echo ${#A['$(echo Darwin ; echo stderr>&2)']} | |
42 | ||
43 | echo ${A[$(echo Darwin ; echo stderr>&2)]:-value} | |
44 | echo ${A['$(echo Darwin ; echo stderr>&2)']:-value} | |
45 | ||
46 | echo ${A[$(echo Darwin ; echo stderr>&2)]:+set} | |
47 | echo ${A['$(echo Darwin ; echo stderr>&2)']:+set} | |
48 | ||
49 | echo ${A[$(echo Darwin ; echo stderr>&2)]:+set} | |
50 | echo ${A['$(echo Darwin ; echo stderr>&2)']:+set} | |
51 | ||
52 | darjeeling=7*6 | |
53 | Darwin=7*4 | |
54 | ||
55 | echo $(( ${A[$(echo Darwin ; echo stderr>&2)]} )) | |
56 | echo $(( ${A['$(echo Darwin ; echo stderr>&2)']} )) |