[PATCH V2 26/26] tools/perf/tests: Fix shellcheck warning for stat+std_output.sh testcase

Athira Rajeev atrajeev at linux.vnet.ibm.com
Mon Jul 10 04:28:00 AEST 2023


Running shellcheck on stat_std_output testcase throws
below warning:

   In tests/shell/stat+std_output.sh line 9:
   . $(dirname $0)/lib/stat_output.sh
     ^-----------^ SC2046 (warning): Quote this to prevent word splitting.

   In tests/shell/stat+std_output.sh line 32:
   	   local -i cnt=0
                    ^-^ SC2034 (warning): cnt appears unused. Verify use (or export if used externally).

Fixed the warning by adding quotes to avoid word splitting
and removed unused variable "cnt" at line 32.

Signed-off-by: Athira Rajeev <atrajeev at linux.vnet.ibm.com>
---
 tools/perf/tests/shell/stat+std_output.sh | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/tools/perf/tests/shell/stat+std_output.sh b/tools/perf/tests/shell/stat+std_output.sh
index 98cc3356a04a..4bfef39baf0a 100755
--- a/tools/perf/tests/shell/stat+std_output.sh
+++ b/tools/perf/tests/shell/stat+std_output.sh
@@ -6,7 +6,7 @@
 
 set -e
 
-. $(dirname $0)/lib/stat_output.sh
+. "$(dirname $0)"/lib/stat_output.sh
 
 stat_output=$(mktemp /tmp/__perf_test.stat_output.std.XXXXX)
 
@@ -29,7 +29,6 @@ trap trap_cleanup EXIT TERM INT
 
 function commachecker()
 {
-	local -i cnt=0
 	local prefix=1
 
 	case "$1"
-- 
2.39.1



More information about the Linuxppc-dev mailing list