how to achieve linux's inotify-tools shell methods on osx

后端 未结 3 455
小蘑菇
小蘑菇 2020-12-30 12:13

To monitor a file in linux, I can use inotify-tools like this

#!/bin/bash

# with inotify-tools installed, watch for modification of file passed as first par         


        
3条回答
  •  一向
    一向 (楼主)
    2020-12-30 12:56

    You can use entr tool. Example usage:

    ls some_file | entr do_something
    

    On Mac install via Brew: brew install entr.

提交回复
热议问题