Commit d352c44a authored by Maciej Wawryk's avatar Maciej Wawryk Committed by Jim Harris
Browse files

test: Shellcheck - correct rule: Consider using grep -c



Correct shellcheck rule SC2126: Consider using
grep -c instead of grep|wc.

Signed-off-by: default avatarMaciej Wawryk <maciejx.wawryk@intel.com>
Change-Id: Iceeef8b4fae984a95543d8d4b9fcbf90e9c073aa
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/473289


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
parent e764b4ca
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -242,7 +242,7 @@ if hash shellcheck 2>/dev/null; then
	# This SHCK_EXCLUDE list is out "to do" and we work to fix all of this errors.
	SHCK_EXCLUDE="SC1083,SC2002,\
SC2010,SC2012,SC2016,SC2034,SC2045,SC2046,SC2068,SC2086,SC2089,SC2090,\
SC2097,SC2098,SC2119,SC2120,SC2126,SC2128,\
SC2097,SC2098,SC2119,SC2120,SC2128,\
SC2129,SC2140,SC2142,SC2143,SC2154,SC2155,\
SC2162"
	# SPDK fails some error checks which have been deprecated in later versions of shellcheck.
+1 −1
Original line number Diff line number Diff line
@@ -79,7 +79,7 @@ function waitforiscsidevices() {
	local num=$1

	for ((i=1; i<=20; i++)); do
		n=$( iscsiadm -m session -P 3 | grep "Attached scsi disk sd[a-z]*" | wc -l )
		n=$( iscsiadm -m session -P 3 | grep -c "Attached scsi disk sd[a-z]*" || true)
		if [ $n -ne $num ]; then
			sleep 0.1
		else