ctubbsii commented on code in PR #5164:
URL: https://github.com/apache/accumulo/pull/5164#discussion_r1878959554
##########
assemble/bin/accumulo-cluster:
##########
@@ -59,14 +59,15 @@ isDebug() {
}
debug() {
- isDebug && echo "${@@P}"
+ isDebug && echo "$1"
+
}
debugAndRun() {
- debug "$@"
+ # Use $* to convert all args as a single argument
+ debug "$*"
if ! isDebug; then
- # shellcheck disable=SC2294
- eval "${@@P}"
+ eval "$(printf "%q " "$@")"
Review Comment:
This might fix the need to use a newer bash version (also note that `@@P`
was never correct... it should always have been `@@Q`). But, it doesn't avoid
the problems with using eval, which requires an additional layer of quote
escaping, making it supremely hard to reason about the executed command. The
use of `eval` in the script is the main bug in this code, not the use of the
new bash features.
--
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]