From 3b80850eaa5c070556560c2e3b18a8a3cc96159a Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Sun, 9 Aug 2020 13:44:56 -0700 Subject: [PATCH] tests/int/update.bats: fix a shellcheck warning This fixes the following warning, and implements a suggestion: > In update.bats line 426: > IFS='/' read -r -a dirs <<< $(echo ${CGROUP_CPU} | sed -e s@^${CGROUP_CPU_BASE_PATH}/@@) > ^-- SC2046: Quote this to prevent word splitting. > ^-- SC2001: See if you can use ${variable//search/replace} instead. Signed-off-by: Kir Kolyshkin --- tests/integration/update.bats | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration/update.bats b/tests/integration/update.bats index 617b1d43..f30746e4 100644 --- a/tests/integration/update.bats +++ b/tests/integration/update.bats @@ -423,7 +423,7 @@ EOF root_period=$(cat "${CGROUP_CPU_BASE_PATH}/cpu.rt_period_us") root_runtime=$(cat "${CGROUP_CPU_BASE_PATH}/cpu.rt_runtime_us") # the following IFS magic sets dirs=("runc-cgroups-integration-test" "test-cgroup") - IFS='/' read -r -a dirs <<< $(echo ${CGROUP_CPU} | sed -e s@^${CGROUP_CPU_BASE_PATH}/@@) + IFS='/' read -r -a dirs <<< "${CGROUP_CPU//${CGROUP_CPU_BASE_PATH}/}" for (( i = 0; i < ${#dirs[@]}; i++ )); do local target="$CGROUP_CPU_BASE_PATH" for (( j = 0; j <= i; j++ )); do