Created
June 30, 2021 10:38
-
-
Save mfurquimdev/202c97845686901cb0715d12db68b47c to your computer and use it in GitHub Desktop.
Execute command on changing file (kills it if it had previously ran)
This file contains hidden or 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
| inotifywait -q -m -e close_write tasks/behaviour_training.py | while read -r filename event; do echo "train@$train_pid"; if [ -n "$train_pid" ]; then echo "Killing"; kill $train_pid; fi; echo "Running"; pipenv run train& train_pid="$!"; done; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment