Hi,
I've created a bash file that calls another bash. And I would like to get the pid from the second file launched, to wait for the file to ends. The second bash file launches processes in background. How can I get the PID from the second bash file?
Here's my code:
Code:
#!/bin/bash
echo "FIRST"
./second.sh
PID=$(echo $!)
wait $PID
echo "CONTINUUING FIRST"