shellcheck complains about SC2086 (info): Double quote to prevent
globbing and word splitting.
The variable `initdir` refers to a path and therefore is safe to be
quoted.
Signed-off-by: Benjamin Drung <benjamin.drung@canonical.com>
# shellcheck disable=SC2155
local _nullglob=$(shopt -p nullglob)
shopt -u nullglob
- # shellcheck disable=SC2086
readarray -t _array < <(
- ls -1 $initdir/etc/udev/rules.d/41-*.rules 2> /dev/null
+ ls -1 "$initdir"/etc/udev/rules.d/41-*.rules 2> /dev/null
)
[[ ${#_array[@]} -gt 0 ]] && mark_hostonly "${_array[@]#$initdir}"
- # shellcheck disable=SC2086
readarray -t _array < <(
- ls -1 $initdir/etc/modprobe.d/s390x-*.conf 2> /dev/null
+ ls -1 "$initdir"/etc/modprobe.d/s390x-*.conf 2> /dev/null
)
[[ ${#_array[@]} -gt 0 ]] && mark_hostonly "${_array[@]#$initdir}"
$_nullglob