I'm working on Ubuntu and I want to create a bash file that do these things:
Launch one program (prog0) on core 1.
Wait 3 seconds.
Then log the information of CPU and Memory usage for prog0 (I use two instances of pidstat on core 0 for logging that information).
Then start another program (prog1) on core 0.
When prog1 has finished (I think that prog1 exits automatically), I would like to exit from all the previous process (prog0 and two pidstat).
taskset -c 1 prog0 -option0 &
sleep 3
taskset -c 0 pidstat 1 -C prog0 -u > log2 &
taskset -c 0 pidstat 1 -C prog0 -r > log3 &
taskset -c 0 prog1 -option1 > log1
I don't know how to exit or kill all the processes started when prog1 has finished.