Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
This demonstrates how a bash script can invoke a child process to do some work asynchronously and monitor for finish
mycommand &
while kill -0 $child_pid >/dev/null 2>&1; do
echo "Child process is still running"
sleep 1
echo "Child process has finished"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment