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
+32 -20
View File
@@ -799,32 +799,44 @@ declare -a aa=([0]="/homes/cj/Desktop:/homes/cj/Library:/homes/cj/Documents")
declare -a aa=([0]="/homes/cj/Desktop:/homes/cj/Library:/homes/cj/Documents")
declare -a aa=([0]="/homes/cj/Desktop:/homes/cj/Library:/homes/cj/Documents" [1]="/homes/cj/Applications")
declare -a aa=([0]="/homes/cj/Desktop:/homes/cj/Library:/homes/cj/Documents" [1]="/homes/cj/Applications")
./array32.sub: line 7: $(echo INJECTION! >&2 ; echo 0): arithmetic syntax error: operand expected (error token is "$(echo INJECTION! >&2 ; echo 0)")
./array32.sub: line 8: declare: a: not found
./array32.sub: line 11: $(echo INJECTION! >&2 ; echo 0): arithmetic syntax error: operand expected (error token is "$(echo INJECTION! >&2 ; echo 0)")
./array32.sub: line 12: declare: a: not found
./array32.sub: line 16: $(echo INJECTION! >&2 ; echo 0): arithmetic syntax error: operand expected (error token is "$(echo INJECTION! >&2 ; echo 0)")
declare -a a=([0]="hi")
./array32.sub: line 22: declare: a: not found
./array32.sub: line 25: $(echo INJECTION! >&2 ; echo 0): arithmetic syntax error: operand expected (error token is "$(echo INJECTION! >&2 ; echo 0)")
./array32.sub: line 26: declare: a: not found
./array32.sub: line 20: $(echo INJECTION! >&2 ; echo 0): arithmetic syntax error: operand expected (error token is "$(echo INJECTION! >&2 ; echo 0)")
./array32.sub: line 21: declare: a: not found
./array32.sub: line 24: $(echo INJECTION! >&2 ; echo 0): arithmetic syntax error: operand expected (error token is "$(echo INJECTION! >&2 ; echo 0)")
./array32.sub: line 25: declare: a: not found
./array32.sub: line 29: $(echo INJECTION! >&2 ; echo 0): arithmetic syntax error: operand expected (error token is "$(echo INJECTION! >&2 ; echo 0)")
declare -a a=([0]="hi")
./array32.sub: line 35: declare: a: not found
./array32.sub: line 38: $(echo INJECTION! >&2 ; echo 0): arithmetic syntax error: operand expected (error token is "$(echo INJECTION! >&2 ; echo 0)")
./array32.sub: line 39: declare: a: not found
./array32.sub: line 42: $(echo INJECTION! >&2 ; echo 0): arithmetic syntax error: operand expected (error token is "$(echo INJECTION! >&2 ; echo 0)")
declare -a a
./array32.sub: line 37: $(echo INJECTION! >&2 ; echo 0): arithmetic syntax error: operand expected (error token is "$(echo INJECTION! >&2 ; echo 0)")
./array32.sub: line 50: $(echo INJECTION! >&2 ; echo 0): arithmetic syntax error: operand expected (error token is "$(echo INJECTION! >&2 ; echo 0)")
declare -a a
./array32.sub: line 44: $(echo INJECTION! >&2 ; echo 0): arithmetic syntax error: operand expected (error token is "$(echo INJECTION! >&2 ; echo 0)")
./array32.sub: line 57: $(echo INJECTION! >&2 ; echo 0): arithmetic syntax error: operand expected (error token is "$(echo INJECTION! >&2 ; echo 0)")
declare -ai a
./array32.sub: line 52: $(echo INJECTION! >&2 ; echo 0): arithmetic syntax error: operand expected (error token is "$(echo INJECTION! >&2 ; echo 0)")
./array32.sub: line 53: $(echo INJECTION! >&2 ; echo 0): arithmetic syntax error: operand expected (error token is "$(echo INJECTION! >&2 ; echo 0)")
./array32.sub: line 55: $(echo INJECTION! >&2 ; echo 0): arithmetic syntax error: operand expected (error token is "$(echo INJECTION! >&2 ; echo 0)")
./array32.sub: line 62: $(echo INJECTION! >&2 ; echo 0): arithmetic syntax error: operand expected (error token is "$(echo INJECTION! >&2 ; echo 0)")
./array32.sub: line 65: $(echo INJECTION! >&2 ; echo 0): arithmetic syntax error: operand expected (error token is "$(echo INJECTION! >&2 ; echo 0)")
./array32.sub: line 66: $(echo INJECTION! >&2 ; echo 0): arithmetic syntax error: operand expected (error token is "$(echo INJECTION! >&2 ; echo 0)")
./array32.sub: line 68: $(echo INJECTION! >&2 ; echo 0): arithmetic syntax error: operand expected (error token is "$(echo INJECTION! >&2 ; echo 0)")
./array32.sub: line 75: $(echo INJECTION! >&2 ; echo 0): arithmetic syntax error: operand expected (error token is "$(echo INJECTION! >&2 ; echo 0)")
declare -a a
./array32.sub: line 64: $(echo INJECTION! >&2 ; echo 0): arithmetic syntax error: operand expected (error token is "$(echo INJECTION! >&2 ; echo 0)")
./array32.sub: line 77: $(echo INJECTION! >&2 ; echo 0): arithmetic syntax error: operand expected (error token is "$(echo INJECTION! >&2 ; echo 0)")
declare -a a
./array32.sub: line 67: $(echo INJECTION! >&2 ; echo 0): arithmetic syntax error: operand expected (error token is "$(echo INJECTION! >&2 ; echo 0)")
./array32.sub: line 80: $(echo INJECTION! >&2 ; echo 0): arithmetic syntax error: operand expected (error token is "$(echo INJECTION! >&2 ; echo 0)")
declare -a a
./array32.sub: line 72: $(echo INJECTION! >&2 ; echo 0): arithmetic syntax error: operand expected (error token is "$(echo INJECTION! >&2 ; echo 0)")
./array32.sub: line 78: $(echo INJECTION! >&2 ; echo 0): arithmetic syntax error: operand expected (error token is "$(echo INJECTION! >&2 ; echo 0)")
./array32.sub: line 85: $(echo INJECTION! >&2 ; echo 0): arithmetic syntax error: operand expected (error token is "$(echo INJECTION! >&2 ; echo 0)")
./array32.sub: line 91: $(echo INJECTION! >&2 ; echo 0): arithmetic syntax error: operand expected (error token is "$(echo INJECTION! >&2 ; echo 0)")
declare -a a=()
./array32.sub: line 82: $(echo INJECTION! >&2 ; echo 0): arithmetic syntax error: operand expected (error token is "$(echo INJECTION! >&2 ; echo 0)")
./array32.sub: line 95: $(echo INJECTION! >&2 ; echo 0): arithmetic syntax error: operand expected (error token is "$(echo INJECTION! >&2 ; echo 0)")
declare -a a=()
declare -A A=([x]="x" )
declare -A A=([1]="1" )
./array33.sub: line 27: f: A: cannot convert associative to indexed array
./array33.sub: line 27: declare: A: cannot convert associative to indexed array
./array33.sub: line 31: A: cannot convert associative to indexed array
declare -A A=([1]="1" )
declare -a A=([0]="x" [1]="x")
./array33.sub: line 40: f: A: cannot convert indexed to associative array
./array33.sub: line 40: declare: A: cannot convert indexed to associative array
declare -a A=([0]="x" [1]="x")
./array33.sub: line 46: A: cannot convert indexed to associative array
declare -a A=([0]="x" [1]="x")