commit bash-20200221 snapshot

This commit is contained in:
Chet Ramey
2020-02-24 10:41:37 -05:00
parent 89d788fb01
commit 0df4ddca3f
19 changed files with 412 additions and 109 deletions
-1
View File
@@ -1,5 +1,4 @@
BUILD_DIR=/usr/local/build/bash/bash-current
#BUILD_DIR=/fs2/chet/scratch/bash-20200214.fifo
THIS_SH=$BUILD_DIR/bash
PATH=$PATH:$BUILD_DIR
+32 -1
View File
@@ -670,7 +670,38 @@ prependå
HELLO;1 foo;2 foo;
PASS;1 foo;2 foo;
after: PASS
'zzz'
'zzz'
declare -rl VAR1
declare -rl VAR1
declare -rl VAR1
declare -rl VAR1
rl
rl
rl
rl
declare -arl VAR3
declare -arl VAR3
declare -arl VAR3
declare -arl VAR3
arl
arl
arl
arl
one
one
'aaa'
'aaa' 'bbb'
./new-exp13.sub: line 56: aaa bbb: invalid variable name
aaa bbb
0 1
'aaa'
'aaa' 'bbb'
'aaa' 'bbb'
'aaa' 'bbb'
a bbb
aaa bb
argv[1] = </>
argv[1] = </>
./new-exp.tests: line 640: ABXD: parameter unset
./new-exp.tests: line 643: ABXD: parameter unset
+3
View File
@@ -620,6 +620,9 @@ ${THIS_SH} ./new-exp11.sub
# indirect expansion with arrays and local variables
${THIS_SH} ./new-exp12.sub
# more indirect expansion and parameter transformation issues
${THIS_SH} ./new-exp13.sub
# problems with stray CTLNUL in bash-4.0-alpha
unset a
a=/a
+72
View File
@@ -0,0 +1,72 @@
# 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 -lr VAR1
declare -lr VAR2=zzz
declare -alr VAR3
var=VAR2
echo ${!var@Q}
echo ${VAR2@Q}
echo ${VAR1@A}
echo ${VAR1[@]@A}
echo "${VAR1@A}"
echo "${VAR1[@]@A}"
echo "${VAR1[@]@a}"
echo ${VAR1[@]@a}
echo "${VAR1@a}"
echo ${VAR1@a}
echo ${VAR3@A}
echo ${VAR3[@]@A}
echo "${VAR3@A}"
echo "${VAR3[@]@A}"
echo "${VAR3[@]@a}"
echo ${VAR3[@]@a}
echo "${VAR3@a}"
echo ${VAR3@a}
var=one
echo ${var}
echo ${var[@]}
VAR4=(aaa bbb)
varname=VAR4
echo ${!varname[@]@Q}
echo ${VAR4[@]@Q}
echo ${!VAR4[@]@Q}
echo ${VAR4[@]}
echo ${!VAR4[@]}
VAR5=(aaa bbb)
varname="VAR5[@]"
echo "${VAR5@Q}"
echo "${VAR5[@]@Q}"
echo "${!varname@Q}"
echo "${!varname[@]@Q}"
# caused core dumps through bash-5.0
echo "${!varname##aa}"
echo "${!varname[@]%b}"
+5 -2
View File
@@ -22,8 +22,8 @@ AVAR
AVAR
42
/bin:/usr/bin:/usr/local/bin:.
avar=([0]="/bin:/usr/bin:/usr/local/bin:.")
z=yy
declare -a avar=([0]="/bin:/usr/bin:/usr/local/bin:.")
declare -- z="yy"
42
declare -i ivar="10"
unset
@@ -61,6 +61,7 @@ g: v = , w =
f: v = , w =
FIN: v = two, w = one
./varenv4.sub: line 67: bbb: unique: cannot convert indexed to associative array
./varenv4.sub: line 67: declare: unique: cannot convert indexed to associative array
after bbb: 1
declare -Ar FOOBAR=([foo]="bar" )
declare -Ar FOOBAR=([foo]="bar" )
@@ -182,6 +183,8 @@ declare -a var=()
./varenv14.sub: line 25: warning: var: cannot inherit value from incompatible type
declare -a var=()
./varenv14.sub: line 31: f: var: cannot convert indexed to associative array
./varenv14.sub: line 31: declare: var: cannot convert indexed to associative array
declare -a var=([0]="12")
declare -a a=([0]="X")
declare -a s=([0]="X")
declare -a a=([0]="X" [1]="Y")