PID & WINPID

Todd Poole tpoole@mail.com
Sun Feb 9 17:35:00 GMT 2014


Thanks for the start but I am little confused on something. The program 
I wish to dump is running, I check the Windows Task Manager and see the 
PID. I execute ps -W and the PID don't match which I assume is correct. 
The PID I need would come from the ps -W. If I execute ps -p myprogram I 
get a list of (3) PID and Commands see below:

$ ps -p myprogram
   PID    PPID    PGID     WINPID   TTY     UID    STIME COMMAND
   4304    3932    4304       4356  pty0    1001 12:12:23 /usr/bin/ps
   4372       1    4372       4372  ?       1001 12:07:01 /usr/bin/mintty
   3932    4372    3932       1364  pty0    1001 12:07:01 usr/bin/bash

How do I know which is the one I need. I obviously can go thru and run 
the dumper on each and to find out which is correct, I tried this and 
(2) of the (3) tell me Failed to open process error 87. On the one 
listed as /usr/bin/mintty it runs.

Thanks


On 2/9/2014 10:17 AM, Steven Penny wrote:
> On Sun, Feb 9, 2014 at 8:54 AM, Todd Poole wrote:
>> What is a simple straight forward way I can code the script to obtain the
>> process cygwin pid by the process name and perform dumper?
>
> This should get you started
>
>      set calc
>      dumper $1 $(ps -W | awk "/$1/,NF=1")
>
> --
> Problem reports:       http://cygwin.com/problems.html
> FAQ:                   http://cygwin.com/faq/
> Documentation:         http://cygwin.com/docs.html
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
>

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple



More information about the Cygwin mailing list