Skip to content

Instantly share code, notes, and snippets.

@nealey
Created September 21, 2017 17:19
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Shell function to block until files are written
# while await-change *.c; do make && ./run; done
await_change () {
ts=/tmp/await-change.$$
: >$ts
while sleep 0.3; do
for fn in "$@"; do
if [ $fn -nt $ts ]; then
rm -f $ts
return
fi
done
done
}
alias await-change=await_change
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment