RohithPariki opened a new pull request, #50950:
URL: https://github.com/apache/arrow/pull/50950
### Rationale for this change
This resolves the ShellCheck warnings and shell pitfalls identified in
#50934 (part of sub-issue #44748). Fixing these issues ensures proper quoting,
avoids word splitting/globbing issues, and makes
`cpp/build-support/run-test.sh` safer and more robust during test runs and CI
workflows.
### What changes are included in this PR?
- Added double quotes to variables across the script (`$TEST_LOGDIR`,
`$TEST_DEBUGDIR`, `$TEST_FILENAME`, `$TEST_WORKDIR`, `$LOGFILE`, `$XMLFILE`,
`$ROOT`, `$TEST_EXECUTABLE`, `$RUN_TYPE`, `$ATTEMPT_NUMBER`,
`$TEST_EXECUTION_ATTEMPTS`, `$TEST_TMPDIR`, and `$STATUS`) to prevent word
splitting and unintended globbing.
- Added explicit `|| exit` and properly quoted `"${BASH_SOURCE[0]}"` and
`"$1"` in directory navigation subshells.
- Updated `rm -f *` to `rm -f ./*` to avoid leading-dash issues with
filenames.
- Replaced `ls /tmp | grep` with direct glob pattern matching (`for COREPATH
in /tmp/core."${FILENAME}"*; do`) to safely handle file discovery.
- Replaced `$*` with `"$@"` in function parameter passing to preserve
whitespace.
- Quoted string assignments like `pipe_cmd="cat"`.
- Added `|| exit` to `popd`.
### Are these changes tested?
Yes, all changes have been checked against ShellCheck rules and verified for
shell syntax correctness.
### Are there any user-facing changes?
No.
* GitHub Issue: #50934
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]