fixes for read builtin with backslash escapes; change history builtin behavior when HISTFILE is unset or null; change to compopt to make it use the name from the actual compspec it uses; fix for executing coproc in functions; fix for array variables and declare -g

This commit is contained in:
Chet Ramey
2023-08-04 11:06:57 -04:00
parent ab99fdbca6
commit dc91b3f509
20 changed files with 1762 additions and 1354 deletions
+47
View File
@@ -0,0 +1,47 @@
# 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/>.
#
# implicit and explicit variable type conversions
declare -A A=(x x)
declare -p A
f() { declare -g A=([1]=1); }
f
declare -p A
unset -f f
# error to convert associative to indexed
f() { declare -ga A=([1]=1); }
f
# error to convert associative to indexed
declare -a A=([1]=1)
declare -p A
unset -v A
declare -a A=(x x)
declare -p A
# error to convert indexed to associative
f() { declare -gA A=([1]=1); }
f
declare -p A
# error to convert indexed to associative
declare -A A=([1]=1)
declare -p A