Usually, fag uses the grep supplied in the path. This behaviour can be
overridden with the environment variable GREP_OVERRIDE.
+ fag works best when PROGRAM's output is line-buffered. stdbuf(1) from
+ the GNU coreutils can adjust buffering options. If a program is still
+ too clever, script(1) creates a pty to wrap around a program.
+
Since 1.2, if fag gets interrupted or terminated before a match is
found (or the timeout has been reached), this signal is passed to
PROGRAM.
Start [mopidy](https://www.mopidy.com/) and wait for the MPD service to have started up:
fag -rV -L /tmp/mopidy.log "MPD server running at" mopidy
+
+
+### On Buffering
+
+Some programs will detect that their output is not going to a terminal and switch to using a large buffer size. Most of the time it is sufficient to wrap such a program with `stdbuf`(1) like so:
+
+ fag PATTTERN stdbuf -oL PROGRAM
+
+Stubborn programs can also be coaxed into line-buffering by executing them in a pty, for example with `script`(1): [via](https://stackoverflow.com/a/55655115)
+
+ script -qfc "$(printf "%q " "$@")" /dev/null
supplied in the path. This behaviour can be overridden with the environment variable
.IR GREP_OVERRIDE .
.PP
+.B fag
+works best when
+.IR PROGRAM 's
+output is line-buffered.
+.BR stdbuf (1)
+from the GNU coreutils can adjust buffering options. If a program is still too clever,
+.BR script (1)
+creates a pty to wrap around a program.
+.PP
Since 1.2, if
.B fag
gets interrupted or terminated before a match is found (or the timeout has been reached), this signal is passed to