kou commented on code in PR #46682:
URL: https://github.com/apache/arrow/pull/46682#discussion_r2123707635
##########
ci/scripts/r_build.sh:
##########
@@ -24,6 +24,12 @@ build_dir=${2}
: "${BUILD_DOCS_R:=OFF}"
+if [ -z "${INSTALL_ARGS}" ] ; then
+ R_INSTALL_ARGS=()
+else
+ read -r -a R_INSTALL_ARGS <<< "$INSTALL_ARGS"
+fi
Review Comment:
> This version doesn't violate shellcheck on my machine.
> But, I want to quote `${INSTALL_ARGS}` part.
> It seems violates SC2086(need quoting).
> (I don't know why this syntax passed shellcheck, by the way)
> However It doesn't work well.
If ShellCheck doesn't report this usage as an error, there is not a problem.
Why do you want to quote this case too?
BTW, we don't need `: "${INSTALL_ARGS:-}"`. We can do it in `for`: `for arg
in ${INSTALL_ARGS:-}; do`
If we want to care glob here, we can disable glob for `INSTALL_ARGS="--X *
--Y"` by `set -f`:
```bash
R_INSTALL_ARGS=()
set -f
for arg in ${INSTALL_ARGS:-}; do
R_INSTALL_ARGS+=("${arg}")
done
set +f
```
But it's also unfamiliar syntax. If we want to use `set -f` too, there is no
advantage than `read`.
--
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]