Do you know where your variables are? | |
PerlMonks |
Re: Help parsing this databy kcott (Archbishop) |
on Aug 13, 2015 at 10:21 UTC ( [id://1138408]=note: print w/replies, xml ) | Need Help?? |
G'day cspctec, I'd read through the ps output adding key-value pairs to a hash with this format:
At the same time, adding any '<defunct>' pids to an array. Then, it's a simple matter to iterate the array of defunct pids and generate the trace from the data in the hash. Here's the sample code (which handles multiple defunct pids):
Output:
Note that the split command uses a LIMIT of 3. This allows '/path/with spaces/to/command' to be captured in full; without that, you'd only capture '/path/with'. — Ken
In Section
Seekers of Perl Wisdom
|
|