more error checking for hash builtin; fix for [[ builtin and some test syntax errors

This commit is contained in:
Chet Ramey
2023-09-13 16:25:28 -04:00
parent 32826f717d
commit 94bce520e8
25 changed files with 1898 additions and 1707 deletions
+3 -1
View File
@@ -12,6 +12,8 @@ returns: 0
returns: 0
returns: 1
returns: 0
./cond.tests: line 65: [[: X: integer expected
returns: 2
returns: 0
returns: 1
returns: 1
@@ -27,7 +29,7 @@ returns: 0
returns: 1
returns: 1
returns: 0
./cond.tests: line 122: [[: 4+: arithmetic syntax error: operand expected (error token is "+")
./cond.tests: line 126: [[: 4+: arithmetic syntax error: operand expected (error token is "+")
returns: 1
returns: 0
returns: 0
+4
View File
@@ -61,6 +61,10 @@ echo returns: $?
[[ -z $UNSET ]]
echo returns: $?
# need to handle test syntax errors and longjmp
[[ -t X ]]
echo returns: $?
# the ==/= and != operators do pattern matching
[[ $TDIR == /usr/homes/* ]]
echo returns: $?