Once you grabbed the fine advice from the other replies and got your trace in place, take a moment to look at Proc::ProcessTable, as using the output of the ps command to parse into a tree is one of the least reliable ways to do. Not only might the output differ suddenly if the system updates the ps process (yes, that also can happen), but it for sure will be different on a different OS!
The output of ps might be similar of Linux distributions, but do not try to port your script to OpenBSD, AIX, HP-UX, Solaris, OSX, Windows, VMS, or OSF/1. Your first surprise may be that many options you used do not even exist!
HP-UX $ ps -eo pid,ppid,comm ps: illegal option -- o usage: ps [-edaxzflP] [-u ulist] [-g glist] [-p plist] [-t tlist] [-R +prmgroup] [-Z psetidlist] AIX $ ps -eo pid,ppid,comm PID PPID COMMAND 1 0 init 78030 143498 xntpd : NetBSD $ ps -eo pid,ppid,comm PID PPID COMMAND 5908 16576 USER=tux LOGNAME=tux HOME=/home/tux PATH=/usr/bin:/bin:/us +r/pkg/bin:/u 22789 5908 USER=tux LOGNAME=tux HOME=/home/tux PATH=/home/tux/bin:/us +r/local/bin: Windows C:\Users\Tux>ps -eo pid,ppid,comm 'ps' is not recognized as an internal or external command, operable program or batch file.
In reply to Re: Help parsing this data
by Tux
in thread Help parsing this data
by cspctec
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |