From fe349098719d16832e22f9ea7849b0c9a468492e Mon Sep 17 00:00:00 2001 From: Lance Hartmann Date: Fri, 14 Dec 2018 18:06:32 -0500 Subject: [PATCH] setup.sh: Fix cleanup in matching files The original mechanism to identify files to cleanup relied on glob matching from the output of 'echo' piped to a grep. This yields a case where some objects can appear and picked up as matching because other items on the same line matched the grep string. Changing this to use 'ls -1' which will restrict the grep string matching to individual lines thereby only picking up the entities the script intended to do. Change-Id: I020c80236fa68bcabeca0299fe7a27f3320de97b Signed-off-by: Lance Hartmann Reviewed-on: https://review.gerrithub.io/437380 Chandler-Test-Pool: SPDK Automated Test System Tested-by: SPDK CI Jenkins Reviewed-by: Karol Latecki Reviewed-by: Shuhei Matsumoto Reviewed-by: Darek Stojaczyk --- scripts/setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/setup.sh b/scripts/setup.sh index 0dd1bf53f..cc3497d9b 100755 --- a/scripts/setup.sh +++ b/scripts/setup.sh @@ -259,7 +259,7 @@ function cleanup_linux { done shopt -u extglob nullglob - files_to_clean+="$(echo /dev/shm/* | egrep '(spdk_tgt|iscsi|vhost|nvmf|rocksdb|bdevtest|bdevperf)_trace|spdk_iscsi_conns' || true) " + files_to_clean+="$(ls -1 /dev/shm/* | egrep '(spdk_tgt|iscsi|vhost|nvmf|rocksdb|bdevtest|bdevperf)_trace|spdk_iscsi_conns' || true) " files_to_clean="$(readlink -e assert_not_empty $files_to_clean || true)" if [[ -z "$files_to_clean" ]]; then echo "Clean"