Skip to content

Instantly share code, notes, and snippets.

@astail
Created May 19, 2015 07:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save astail/a0d578a4db4c60522774 to your computer and use it in GitHub Desktop.
Save astail/a0d578a4db4c60522774 to your computer and use it in GitHub Desktop.
#!/bin/sh
set -e
lockfile=${TMP:-/tmp}/${0##*/}
i=1
while [ $i -eq 1 ]; do
if [ ! -e $lockfile ]; then
i=`expr $i + 1`
fi
done
touch $lockfile
echo hogehoge && sleep 10s && echo piyo
rm $lockfile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment