Process ID
Hello,
I would like to do something like that in a shell script
MyProcessA &
MyProcessB &
MyProcessC &
echo "My processes started"
wait MyProcessA
wait MyProcessB
wait MyProcessC
echo "My processes finished"
The wait command can receive a PID and wait for its completion. But I do not know how to get the PID of MyProcessA when I start it. I do not want to use the ps command because MyProcessA may be finished then. All I want is the PID that you have when you type "MyProcessA &". Ex:
/users/timok/tests/shell>mkdir toto &
[1] 1058
So I would like to get the value '1058' in a variable.
Thanks for any help,
Timok
|