From 1c1d2e3a9ba6564a37f97b17c6a5abd32933df19 Mon Sep 17 00:00:00 2001 From: Chris Koeritz Date: Sat, 8 Mar 2014 16:39:40 -0500 Subject: [PATCH] updated to uniquify list of process ids found. --- scripts/core/functions.sh | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/scripts/core/functions.sh b/scripts/core/functions.sh index 286d6f5c..3b3c95e2 100644 --- a/scripts/core/functions.sh +++ b/scripts/core/functions.sh @@ -85,14 +85,12 @@ if [ -z "$skip_all" ]; then if [ ! -d c:/tmp ]; then mkdir c:/tmp fi - # windows7 magical mystery tour lets us create a file c:\\tmp_pids.txt, but then it's not really there - # in the root of drive c: when we look for it later. hoping to fix that problem by using a subdir, which - # also might be magical thinking from windows perspective. + # windows7 magical mystery tour lets us create a file c:\\tmp_pids.txt, but then it's not + # really there in the root of drive c: when we look for it later. hoping to fix that + # problem by using a subdir, which also might be magical thinking from windows perspective. tmppid=c:\\tmp\\pids.txt - # we have abandoned all hope of relying on ps on windows. instead - # we use wmic to get full command lines for processes. - # this does not exist on windows home edition. we are hosed if that's - # what they insist on testing on. + # we have abandoned all hope of relying on ps on windows. instead we use wmic to get full + # command lines for processes. wmic /locale:ms_409 PROCESS get processid,commandline "$tmppid" local flag='/c' if [ ! -z "$(uname -a | grep "^MING" )" ]; then @@ -125,7 +123,10 @@ if [ -z "$skip_all" ]; then | sed -n -e "$appropriate_pattern")) done fi - if [ ${#PIDS_SOUGHT[*]} -ne 0 ]; then echo ${PIDS_SOUGHT[*]}; fi + if [ ${#PIDS_SOUGHT[*]} -ne 0 ]; then + PIDS_SOUGHT=$(echo ${PIDS_SOUGHT[*]} | sort | uniq) + echo ${PIDS_SOUGHT[*]} + fi /bin/rm $PID_DUMP } -- 2.34.1