Commit 6233bb4
committed
fix: oscap-ssh: instead of expr/let, use (( )) form
Handle options conversions up to 2nd last arg as last is input and is
handled next.
(( ..., 1 )) ensures return value is ok.
arr[-1] is last element
From shellcheck:
In utils/oscap-ssh line 217:
for i in $(seq 0 `expr $# - 1`); do
^-----------^ SC2046: Quote this to prevent word splitting.
^-----------^ SC2006: Use $(...) notation instead of legacy backticked `...`.
^--^ SC2003: expr is antiquated. Consider rewriting this using $((..)), ${} or [[ ]].
Did you mean:
for i in $(seq 0 $(expr $# - 1)); do
In utils/oscap-ssh line 218:
let j=i+1
^-------^ SC2219: Instead of 'let expr', prefer (( expr )) .
In utils/oscap-ssh line 267:
LOCAL_CONTENT_PATH="${oscap_args[`expr $# - 1`]}"
^-----------^ SC2006: Use $(...) notation instead of legacy backticked `...`.
^--^ SC2003: expr is antiquated. Consider rewriting this using $((..)), ${} or [[ ]].
Did you mean:
LOCAL_CONTENT_PATH="${oscap_args[$(expr $# - 1)]}"
In utils/oscap-ssh line 268:
oscap_args[`expr $# - 1`]="$REMOTE_TEMP_DIR/input.xml"
^-----------^ SC2006: Use $(...) notation instead of legacy backticked `...`.
^--^ SC2003: expr is antiquated. Consider rewriting this using $((..)), ${} or [[ ]].
Did you mean:
oscap_args[$(expr $# - 1)]="$REMOTE_TEMP_DIR/input.xml"1 parent ff3cf70 commit 6233bb4
1 file changed
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
217 | | - | |
218 | | - | |
| 217 | + | |
| 218 | + | |
219 | 219 | | |
220 | 220 | | |
221 | 221 | | |
| |||
264 | 264 | | |
265 | 265 | | |
266 | 266 | | |
267 | | - | |
268 | | - | |
| 267 | + | |
| 268 | + | |
269 | 269 | | |
270 | 270 | | |
271 | 271 | | |
| |||
0 commit comments