1. 15
  1.  

  2. 14

    My personal favorite for this task is entr(1): http://entrproject.org/

    1. 2

      +1 and it works on OS X as well.

      1. 2

        Cool! Thanks for pointing that out. (edits: grammar)

        1. 1

          My one qualm with entr is how it deals with new files. It should handle that itself, not require calling it in a loop.

        2. 6

          I’m a huge fan of wendy(1): http://git.z3bra.org/wendy/file/README.html

          So much so that it’s pretty much one of my core utilities when writing scripts these days.

          1. 2

            I also use this when working on scientific figures generated by scripts. E.g.:

            while ! unchanged figure.py; do python figure.py; done;

            1. 2

              Nice! I recently created a script to do poor man’s hot reloading using inotifywait. When files in the GOPATH change, the project is checked to see if “go install” would update anything. If so the project is rebuilt and then the binary restarted. A dozen lines of bash goes a long way. https://gist.github.com/shanemhansen/128f5a3ea3acd5cf18c7a8a14261ed68

              1. 2

                If that setup is for web stuff, also have a look at devd, which will do things like reload the page when the new binary is built.