Skip to content

Instantly share code, notes, and snippets.

@tubaman
Created June 23, 2020 23:38
Show Gist options
  • Save tubaman/00b792221bd75fbbca61184da3d414ce to your computer and use it in GitHub Desktop.
Save tubaman/00b792221bd75fbbca61184da3d414ce to your computer and use it in GitHub Desktop.
waitpid for the linux command line
#!/bin/bash
# Wait for a process(es) to finish by pid
# https://stackoverflow.com/a/41613532
for pid in $@; do
tail --sleep-interval=0.250 --pid=$pid -f /dev/null
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment