Use [*] instead of [@] for array expansion inside a string #2098
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Relax-and-Recover (ReaR) Pull Request Template
Please fill in the following items before submitting a new pull request:
Pull Request Details:
Type: Style Cleanup
Impact: Low
Reference to related issue (URL):
https://github.com/rear/rear/pull/1887/files#r268264260
How was this pull request tested?
Code analysis and experimenting with analogous snippets of bash code.
Brief description of the changes in this pull request:
Array expansion inside strings like
"aaa ${boot_list[@]} bbb"
splits the string into several strings:->
"aaa foo" "bar bbb"
instead of"aaa foo bar bbb"
. This is probably unintended, although harmless in this case.Change
[@]
to a more intuitive[*]
, which keeps the result of expansion as one string.See https://github.com/koalaman/shellcheck/wiki/SC2145