mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-06-21 12:57:58 +02:00
88 lines
1.6 KiB
Plaintext
88 lines
1.6 KiB
Plaintext
# This program is free software: you can redistribute it and/or modify
|
|
# it under the terms of the GNU General Public License as published by
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
# (at your option) any later version.
|
|
#
|
|
# This program is distributed in the hope that it will be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU General Public License for more details.
|
|
#
|
|
# You should have received a copy of the GNU General Public License
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
#
|
|
|
|
declare -i x
|
|
x='a[${ unset x;}]'
|
|
declare -p x
|
|
unset x
|
|
|
|
declare -a a
|
|
x=a[${ unset x;}]
|
|
declare -p x
|
|
unset x
|
|
|
|
x=a[${ unset x;}]
|
|
declare -p x
|
|
unset x
|
|
|
|
x=${ unset x; }
|
|
declare -p x
|
|
unset x
|
|
|
|
declare -a x
|
|
x[0]=abc
|
|
x=${ unset x; }
|
|
declare -p x
|
|
unset x
|
|
|
|
declare -i x
|
|
x='a[${ unset x;}]' printenv x
|
|
declare -p x
|
|
unset x
|
|
|
|
declare -i x
|
|
x=${ unset x;}
|
|
declare -p x
|
|
unset x
|
|
|
|
declare -i x
|
|
x='${ unset x;}'
|
|
declare -p x
|
|
unset x
|
|
|
|
( SECONDS=${ unset SECONDS; }
|
|
declare -p SECONDS
|
|
unset SECONDS )
|
|
|
|
( SECONDS='${ unset SECONDS; }'
|
|
declare -p SECONDS )
|
|
|
|
declare -i x='a[${ unset x; }]'
|
|
declare -p x
|
|
unset x
|
|
|
|
declare -ia x=(3 5 7 9)
|
|
declare -n foo='x[2]'
|
|
foo=a[${ unset x; }]
|
|
declare -p x
|
|
unset x
|
|
|
|
declare -ai a=(1 'b[${ unset a; }]' 3)
|
|
declare -p a
|
|
unset a
|
|
|
|
declare -ai a=(1 "b[${ unset a; }]" 3)
|
|
declare -p a
|
|
unset a
|
|
|
|
# uses kvpair-style
|
|
declare -Ai a=(1 'b[${ unset a; }]' 3)
|
|
declare -p a
|
|
unset a
|
|
|
|
# uses kvpair-style
|
|
declare -Ai a=(1 "b[${ unset a; }]" 3)
|
|
declare -p a
|
|
unset a
|