Computing.Net > Forums > Unix > Display history of processes?

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Display history of processes?

Reply to Message Icon

Name: dado1
Date: September 21, 2005 at 18:08:23 Pacific
OS: Win XP
CPU/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!




Sponsored Link
Ads by Google

Response Number 1
Name: Jim Boothe
Date: September 22, 2005 at 07:06:53 Pacific
Reply:

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 sh

cat myscript
echo "Me: $$   Parent: $PPID"

myscript
Me: 6817   Parent: 5493

. myscript
Me: 5493   Parent: 5492


0

Response Number 2
Name: Dlonra
Date: September 23, 2005 at 06:59:28 Pacific
Reply:

include
echo "I am $$, my parent is $PPID"
ps -eaf|egrep "$$|$PPID"|egrep -v "ps |grep "


0

Response Number 3
Name: dado1
Date: September 24, 2005 at 09:53:37 Pacific
Reply:

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.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: Display history of processes?

history of changes in a file www.computing.net/answers/unix/history-of-changes-in-a-file/8234.html

Unix History www.computing.net/answers/unix/unix-history/1612.html

The status of process www.computing.net/answers/unix/the-status-of-process-/2315.html