Created
May 2, 2017 19:24
-
-
Save floreo/5a3fecacd97f7056973a67d59fd01827 to your computer and use it in GitHub Desktop.
Simple pid script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
_pid="$HOME/$0.pid" | |
while : | |
do | |
if [ ! -s "${_pid}" ] ; then | |
echo $$ >"${_pid}" | |
echo "Doing real stuff" | |
rm "${_pid}" | |
break | |
else | |
echo "waiting for $(cat ${_pid}) to finish" | |
sleep 10 | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment