Hi Kairui,
On Thu, 12 Aug 2021 13:47:32 +0800 Kairui Song kasong@redhat.com wrote:
As suggested by: https://github.com/koalaman/shellcheck/wiki/SC2199
Signed-off-by: Kairui Song kasong@redhat.com
dracut-module-setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index c2a690b9..4eee564d 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -94,7 +94,7 @@ kdump_setup_dns() {
_tmp=$(get_nmcli_value_by_field "$_nm_show_cmd" "IP4.DNS") array=(${_tmp//|/ })
- if [[ ${array[@]} ]]; then
- if [[ ${array[*]} ]]; then
^^^^^^^^^^^ In the example given in SC2199 the string gets quoted. Not sure if it makes a difference here.
Thanks Philipp
for _dns in "${array[@]}" do echo "nameserver=$_dns" >> "$_dnsfile"