Process wait script
Often times I would run commands that depended on processes to finish on another tab within a screen session. Unfortunately, bash’s wait command only works within the existing shell, so I came up with a quick script to check versus executable name.
#!/bin/bash
if [ $# -ne 0 ]; then
while pgrep ^$1 > /dev/null; do sleep 1; done;
else
echo "Invalid Arguments"
exit 1
fi
Obviously it’s a pretty simple script, and currently only matches commands at the beginning. A simple modification to check for pids instead would be fairly simple.
If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.

I am sure that i will come back to your blog soon. Keep us posting