Last active
March 19, 2017 03:47
-
-
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.
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
# concat.sh | |
cat \ | |
file1 \ | |
file3 \ | |
> file3 |
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
fswatch -o file1 \ | |
file2 \ | |
| xargs -n1 sh concat.sh; |
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
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