Skip to content

Commit 4760cf8

Browse files
authored
fix shellcheck findings
1 parent a38f473 commit 4760cf8

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

yabs.sh

+6-6
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ elif [ -z "$SKIP_FIO" ]; then
673673
JSON_RESULT+=',"speed_w":'${DISK_RESULTS_RAW[(DISK_COUNT+1)*6+2]}',"iops_w":'${DISK_RESULTS_RAW[(DISK_COUNT+1)*6+5]}',"speed_rw":'${DISK_RESULTS_RAW[(DISK_COUNT+1)*6]}
674674
JSON_RESULT+=',"iops_rw":'${DISK_RESULTS_RAW[(DISK_COUNT+1)*6+3]}',"speed_units":"KBps"},'
675675
fi
676-
DISK_COUNT=$(($DISK_COUNT + 2))
676+
DISK_COUNT=$((DISK_COUNT + 2))
677677
done
678678
[[ -n $JSON ]] && JSON_RESULT=${JSON_RESULT::${#JSON_RESULT}-1} && JSON_RESULT+=']'
679679
fi
@@ -982,7 +982,7 @@ function launch_geekbench {
982982

983983
# if the skip geekbench flag was set, skip the system performance test, otherwise test system performance
984984
if [ -z "$SKIP_GEEKBENCH" ]; then
985-
[[ -n $JSON ]] && JSON_RESULT+=(",\"geekbench\":[")
985+
[[ -n $JSON ]] && JSON_RESULT+=",\"geekbench\":["
986986
if [[ $GEEKBENCH_4 == *True* ]]; then
987987
launch_geekbench 4
988988
fi
@@ -994,8 +994,8 @@ if [ -z "$SKIP_GEEKBENCH" ]; then
994994
if [[ $GEEKBENCH_6 == *True* ]]; then
995995
launch_geekbench 6
996996
fi
997-
[[ -n $JSON ]] && [[ "${JSON_RESULT: -1}" == ',' ]] && JSON_RESULT=$(echo "$JSON_RESULT" | sed 's/,$//')
998-
[[ -n $JSON ]] && JSON_RESULT+=']'
997+
[[ -n $JSON ]] && [[ "${JSON_RESULT: -1}" == ',' ]] && JSON_RESULT="${JSON_RESULT%,}"
998+
[[ -n $JSON ]] && JSON_RESULT+="]"
999999
fi
10001000

10011001
# finished all tests, clean up all YABS files and exit
@@ -1021,13 +1021,13 @@ function calculate_time_taken() {
10211021
else
10221022
echo "YABS completed in ${time_taken} sec"
10231023
fi
1024-
[[ -n $JSON ]] && JSON_RESULT+=',"runtime":{"start":'$start_time',"end":'$end_time',"elapsed":'$time_taken'}'
1024+
[[ -n $JSON ]] && JSON_RESULT+=",\"runtime\":{\"start\":'$start_time',\"end\":'$end_time',\"elapsed\":'$time_taken'}"
10251025
}
10261026

10271027
calculate_time_taken "$YABS_END_TIME" "$YABS_START_TIME"
10281028

10291029
if [[ -n $JSON ]]; then
1030-
JSON_RESULT+='}'
1030+
JSON_RESULT+="}"
10311031

10321032
# write json results to file
10331033
if [[ $JSON = *w* ]]; then

0 commit comments

Comments
 (0)