ENTR(1)

NAME
entr - run arbitrary commands when files change

SYNOPSIS
entr [-r] utility [arguments ...]
entr +fifo

DESCRIPTION
entr has two modes of operation; the first use reads a list of files provided on STDIN and executes the supplied utility if any of them change. entr waits for the child process to finish before responding to subsequent file system events. A TTY is opened before entering the watch loop in order to support the invocation of interactive utilities.

-r modifies the exec mode by launching the utility and reloading it if one of the source files change. This features requires the application to exit if it receives SIGTERM.

The second mode also reads a list of filenames provided on STDIN and is enabled by specifying '+' and the name of a fifo. In this mode entr enables more sophisticated scripting by writing filenames to a named pipe when they are modified.

EXIT STATUS
The entr utility does not normally return, but it will exit with a value of 0 if the signal SIGINT or SIGTERM was received.

EXAMPLES

Recompile when source files change

    $ find. -name '*.c' | entr make

Launch and auto-reload a node.js server

    $ echo *.js | entr -r node index.js

Convert individual Markdown files to HTML if they're modified

    $ ls *.md | entr +notify &
    $ while read F; do
    > markdown2html $F
    > done < notify