From adf1a5158e851b5a03f16d289dd302116b193c61 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 (master) Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/448456 Reviewed-by: Jim Harris Reviewed-by: Ben Walker Tested-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 22e726de52..d13e0c43ee 100755 --- a/scripts/setup.sh +++ b/scripts/setup.sh @@ -251,7 +251,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"