Linux: Triggering Shell Command On File Save

拟墨画扇 提交于 2019-12-22 08:46:30

问题


I want to automatically trigger a shell command when a file is modified. I think this can be accomplished in code by registering an inotify hook and call to system, however is there a higher level bash command that can accomplish this?


回答1:


Try inotify-tools. I'm having problems copying the link (sorry), but there is a wiki on GitHub which yu should be able to find with G-search-engine.




回答2:


I don't have a solution to your problem, but I've found this nice program that you might use the feature you request: cwatch



来源:https://stackoverflow.com/questions/10366411/linux-triggering-shell-command-on-file-save

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!