Shell code cleanup
- Argument mixes string and array. Use * or separate argument.
- Quote the grep pattern so the shell won't interpret it.
- Use "${var:?}" to ensure this never expands to /* .
- > is for string comparisons. Use -gt instead.
- Quote the parameter to -name so the shell won't interpret it.
Closes #4163.
PiperOrigin-RevId: 179042046
diff --git a/src/test/shell/integration/java_integration_test.sh b/src/test/shell/integration/java_integration_test.sh
index e780b8b..f4bf19b 100755
--- a/src/test/shell/integration/java_integration_test.sh
+++ b/src/test/shell/integration/java_integration_test.sh
@@ -317,7 +317,7 @@
# https://github.com/bazelbuild/bazel/issues/3156
local -r first_run="$(md5_file $(find "${PRODUCT_NAME}-out/" -type f '!' \
-name build-changelist.txt -a '!' -name volatile-status.txt \
- -a '!' -name stderr-* -a '!' -name *.a \
+ -a '!' -name 'stderr-*' -a '!' -name '*.a' \
-a '!' -name __xcodelocatorcache -a '!' -name __xcruncache \
| sort -u))"
@@ -328,7 +328,7 @@
|| fail "Build failed"
local -r second_run="$(md5_file $(find "${PRODUCT_NAME}-out/" -type f '!' \
-name build-changelist.txt -a '!' -name volatile-status.txt \
- -a '!' -name stderr-* -a '!' -name *.a \
+ -a '!' -name 'stderr-*' -a '!' -name '*.a' \
-a '!' -name __xcodelocatorcache -a '!' -name __xcruncache \
| sort -u))"