Since your kill command failed because pid empty.
pid=$(ps | grep './process1.sh' |grep -v grep| awk '{print $1}')
This does not give you the pid you want. When you start a process in the background, it runs in a new shell and you will not see the output of process.sh in your ps.
What you can do is save the PID when starting background processes and kill them:
./process1.sh & pid1=$!
Then get the PID from this file and pass it kill .
source share