Display history of processes?
|
Original Message
|
Name: dado1
Date: September 21, 2005 at 18:08:23 Pacific
Subject: Display history of processes?OS: Win XPCPU/Ram: 1GB |
Comment: Is there a way to display the history of all processes using some shell command? I want to prove that when I run my script, that it is executed in a different process. Help is appreciated!
Report Offensive Message For Removal
|
|
Response Number 1
|
Name: Jim Boothe
Date: September 22, 2005 at 07:06:53 Pacific
Subject: Display history of processes? |
Reply: (edit)No process history, but a script can display its process ID, and that of its parent's. In the example below, my shell process is 5493. The first execution of myscript runs in its own new shell, but the 2nd execution was preceded by a dot, and you can see that execution runs in the current 5493 shell, which is how you run a script when you want it to impact the current shell.ps PID TTY TIME COMMAND 5964 pts/tb 0:00 ps 5492 pts/tb 0:00 telnetd 5493 pts/tb 0:00 shcat myscript echo "Me: $$ Parent: $PPID"myscript Me: 6817 Parent: 5493. myscript Me: 5493 Parent: 5492
Report Offensive Follow Up For Removal
|
|
Response Number 2
|
Name: Dlonra
Date: September 23, 2005 at 06:59:28 Pacific
Subject: Display history of processes? |
Reply: (edit)include echo "I am $$, my parent is $PPID" ps -eaf|egrep "$$|$PPID"|egrep -v "ps |grep "
Report Offensive Follow Up For Removal
|
|
Response Number 3
|
Name: dado1
Date: September 24, 2005 at 09:53:37 Pacific
Subject: Display history of processes? |
Reply: (edit)Hi, thank you for the replies. I also remembered that I can just put 'ps' im my script and it will display the process even after it is finished.
Report Offensive Follow Up For Removal
|
Use following form to reply to current message: