From: Chris Koeritz Date: Wed, 7 Mar 2012 21:51:24 +0000 (-0500) Subject: trying to placate win7 which is injecting extra CRs on the end of our output not. X-Git-Tag: 2.140.90~1502 X-Git-Url: https://feistymeow.org/gitweb/?a=commitdiff_plain;h=f1963cf6c1ba2b01e0e36b4bfac1aba664ec9d5a;p=feisty_meow.git 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. --- 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" \