trying to placate win7 which is injecting extra CRs on the end of our output not.
authorChris Koeritz <fred@gruntose.com>
Wed, 7 Mar 2012 21:51:24 +0000 (16:51 -0500)
committerChris Koeritz <fred@gruntose.com>
Wed, 7 Mar 2012 21:51:24 +0000 (16:51 -0500)
thanks windows 7!  you and cygwin sure know how to exterminate productivity.

scripts/core/functions.sh

index 4ab3ec1c185b539cd247faf7024b5918ea325721..6a5253c7748253cb3c019d8de7e16f6ce8ff9951 100644 (file)
@@ -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='\r'  # 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" \