From f1963cf6c1ba2b01e0e36b4bfac1aba664ec9d5a Mon Sep 17 00:00:00 2001 From: Chris Koeritz Date: Wed, 7 Mar 2012 16:51:24 -0500 Subject: [PATCH] trying to placate win7 which is injecting extra CRs on the end of our output not. thanks windows 7! you and cygwin sure know how to exterminate productivity. --- scripts/core/functions.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/core/functions.sh b/scripts/core/functions.sh index 4ab3ec1c..6a5253c7 100644 --- a/scripts/core/functions.sh +++ b/scripts/core/functions.sh @@ -57,7 +57,8 @@ if [ -z "$skip_all" ]; then # we 'type' the file to get rid of the unicode result from wmic. cmd $flag type "$tmppid" >$PID_DUMP \rm "$tmppid" - local appropriate_pattern='s/^.* *\([0-9][0-9]*\) *$/\1/p' + local CR=' ' # embedded carriage return. + local appropriate_pattern="s/^.* *\([0-9][0-9]*\)[ $CR]*\$/\1/p" for i in "${patterns[@]}"; do PIDS_SOUGHT+=$(cat $PID_DUMP \ | grep -i "$i" \ -- 2.34.1