11/8/2023 0 Comments Freefilesync mac how to automateHowever, beware that it assumes that the file name doesn't contain whitespace. The second snippet doesn't have this defect. The first snippet is simpler, but it has a significant downside: it will miss changes performed while inotifywait isn't running (in particular while myfile is running). Or inotifywait -q -m -e close_write myfile.py | Simple, using inotifywait (install your distribution's inotify-tools package): while inotifywait -e close_write myfile.py do. Since I need to accept only one, I'm accepting the one that I've actually used (it was simple, quick and easy-to-remember), even though I know it is not the most elegant. What's more, I want something to run in a terminal because I want to see the program output (I want to see error messages).Ībout the answers: Thanks for all your answers! All of them are very good, and each one takes a very different approach from the others. Update: I want something simple, discardable if possible. myfile.py doneīTW: I'm using Vim, and I know I can add an autocommand to run something on BufWrite, but this is not the kind of solution I want now. What I want is something like this: while sleep_until_file_has_changed myfile.py do. myfile.py doneĪnd then I need to go to that terminal and press Enter, whenever I save that file on my editor. I want something very simple, something I will leave running on a terminal and close it whenever I'm finished working with that file.Ĭurrently, I'm using this: while read do. I want a quick and simple way to execute a command whenever a file changes.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |