Skip to content

Instantly share code, notes, and snippets.

@mattConn
Last active March 19, 2017 03:47
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 mattConn/85335857c26853592db52e61286cf993 to your computer and use it in GitHub Desktop.
Save mattConn/85335857c26853592db52e61286cf993 to your computer and use it in GitHub Desktop.
Simple watch scripts; one for Linux that uses inotifytools, one for Mac that uses fswatch. On file change, concat.sh is run and concatenates listed files.
# concat.sh
cat \
file1 \
file3 \
> file3
fswatch -o file1 \
file2 \
| xargs -n1 sh concat.sh;
while inotifywait -e close_write \
file1 \
file2 \
do sh concat.sh; done;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment