Skip to contentSkip to conversation

master - tests: check.sh drop unnecessary $

PATCH Zdenek Kabelac 1 participant 1 message Jun 29, 2017

lore
Share & tools
lore
#0 lore raw
Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=db338c2b42abb6b5274fba5f93a982241afa8ecf
Commit:        db338c2b42abb6b5274fba5f93a982241afa8ecf
Parent:        c0197040a5c68af8314b5466c8b1f61b381044f6
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Thu Jun 29 09:37:20 2017 +0200
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Thu Jun 29 22:23:17 2017 +0200

tests: check.sh drop unnecessary $

$/${} is unnecessary on arithmetic variables.

---
 test/lib/check.sh |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
test/lib/check.sh +3 -3
index 1ec1bab..8555235 100644
@@ -208,14 +208,14 @@ in_sync() {
 		# 6th argument is the sync ratio for RAID
 		idx=6
 		type=${a[3]}
-		if [ "${a[$(($idx + 1))]}" != "idle" ]; then
+		if [ "${a[$(( idx + 1 ))]}" != "idle" ]; then
 			echo "$lvm_name ($type$snap) is not in-sync"
 			return 1
 		fi
 		;;
 	"mirror")
 		# 4th Arg tells us how far to the sync ratio
-		idx=$((${a[3]} + 4))
+		idx=$(( a[3] + 4 ))
 		type=${a[2]}
 		;;
 	*)
@@ -230,7 +230,7 @@ in_sync() {
 		return 1
 	fi
 
-	if [[ ${a[$(($idx - 1))]} =~ a ]] ; then
+	if [[ ${a[$(( idx - 1 ))]} =~ a ]] ; then
 		[ $ignore_a -eq 0 ] && \
 			die "$lvm_name ($type$snap) in-sync, but 'a' characters in health status"
 		echo "$lvm_name ($type$snap) is not in-sync"