From 855dba2d974980e29fd908bab5f19925d8d479e5 Mon Sep 17 00:00:00 2001 From: Maciej Wawryk Date: Mon, 2 Dec 2019 12:29:25 +0100 Subject: [PATCH] test: Shellcheck - correct rule: Quotes/backslashes... Correct shellcheck rule SC2089: Quotes/backslashes will be treated literally. Use an array. Signed-off-by: Maciej Wawryk Change-Id: I40d4eef334cd030294669f8e8494f9e7a563d495 Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/476466 Tested-by: SPDK CI Jenkins Reviewed-by: Jim Harris Reviewed-by: Tomasz Zawadzki Reviewed-by: Karol Latecki Reviewed-by: Shuhei Matsumoto --- scripts/check_format.sh | 2 +- scripts/setup.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/check_format.sh b/scripts/check_format.sh index e3a7a8eb66..d3b8123bc3 100755 --- a/scripts/check_format.sh +++ b/scripts/check_format.sh @@ -241,7 +241,7 @@ if hash shellcheck 2>/dev/null; then # Error descriptions can also be found at: https://github.com/koalaman/shellcheck/wiki # This SHCK_EXCLUDE list is out "to do" and we work to fix all of this errors. SHCK_EXCLUDE="SC1083,SC2002,\ -SC2010,SC2034,SC2045,SC2046,SC2086,SC2089,SC2090,\ +SC2010,SC2034,SC2045,SC2046,SC2086,SC2090,\ SC2097,SC2098,SC2119,SC2120" # SPDK fails some error checks which have been deprecated in later versions of shellcheck. # We will not try to fix these error checks, but instead just leave the error types here diff --git a/scripts/setup.sh b/scripts/setup.sh index fed8c75b21..baafe15e12 100755 --- a/scripts/setup.sh +++ b/scripts/setup.sh @@ -653,8 +653,8 @@ function configure_freebsd_pci { GREP_STR="${GREP_STR}\|chip=0x${dev_id}8086" done < $TMP - AWK_PROG="{if (count > 0) printf \",\"; printf \"%s:%s:%s\",\$2,\$3,\$4; count++}" - echo $AWK_PROG > $TMP + AWK_PROG=("{if (count > 0) printf \",\"; printf \"%s:%s:%s\",\$2,\$3,\$4; count++}") + echo "${AWK_PROG[*]}" > $TMP BDFS=$(pciconf -l | grep "${GREP_STR}" | awk -F: -f $TMP)