Skip to content

Instantly share code, notes, and snippets.

@aurelijusb
Created October 6, 2013 16:41
Show Gist options
  • Save aurelijusb/6856208 to your computer and use it in GitHub Desktop.
Save aurelijusb/6856208 to your computer and use it in GitHub Desktop.
Small script used to compile/execute code on save: E.g. ./iocron.sh folder/ "echo '=====================' && date && echo '=====================' && php folder/test.php"
#!/bin/sh
# About:
# Execute command when file is changed.
#
# Usage:
# ./iocron.sh filt/to/watch "echo 'command'"
#
# Dependencies
# sudo apt-get install inotify-tools
while true; do
inotifywait -q $1 > /dev/null
eval $2
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment