Hello - I didn't find this with search, but I'm guessing it's out there somewhere. Apologies for reposting if that's the case.
I'm shell scripting on a 10.5.8 Mac.
I want to make a program that runs in the background and periodically logs computer use, storing things like - cpu usage, programs running, etc. I know I can get the pid of the most recently called process with $!, but is there a way to get the pid of any arbitrary process, or even to see all pids in use at one time? Do all processes have single, unique pids?
Is it possible to see the number of windows open at any one time?
Thanks.