I am creating a script using ksh where a process (simple_script.sh) is executed and iterates 5 times. What I need to do is get the pid each time the process is executed and store them in an array. So far I can get the script to execute simple_script.sh 5 times,but have been unable to get the pid's into an array.
while [ "$i" -lt 5 ]
do
./simple_script.sh
pids[$i]=$!
i=$((i+1))
done