]> git.ipfire.org Git - thirdparty/bash.git/blob - tests/builtins4.sub
bash-5.1 distribution sources and documentation
[thirdparty/bash.git] / tests / builtins4.sub
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 declare -a c
15 declare -p c
16
17 declare -A d
18 declare -p d
19 unset c d
20
21 declare -a c
22 c=4
23 declare -p c
24 unset c
25
26 declare -A c
27 c=4
28 declare -p c
29 unset c
30
31 declare -a c
32 c=(1 2 3)
33 declare -p c
34 unset c
35
36 declare -A c
37 c=([one]=1 [two]=2 [three]=3)
38 declare -p c
39 unset c
40
41 declare -a c
42 read -a c < <(echo 1 2 3)
43 declare -p c
44 unset c
45
46 declare -a c
47 mapfile -t c < <(echo 1$'\n'2$'\n'3)
48 declare -p c
49 unset c
50
51 unset foo
52 declare -A foo
53 echo ${foo-unset}
54
55 unset foo
56 declare -a foo
57 echo ${foo-unset}