Skip to main content
add better answer
Source Link
JP Lew
  • 171
  • 7

I found the answer here: https://stackoverflow.com/a/23030127/1011766

Because fswatch is a long-running process, I had to use sed's -u flag to unbuffer the stream.

-u, --unbuffered

       load minimal amounts of data from the input files and flush the output buffers more often

This simple fix did it:

fswatch -xr mysitedir | sed -un '/Updated$/p' | xargs -L1 -I {} echo {}


NOTE

Better solution from @cas for my specific use-case is to use fswatch's built-in --event flag:

fswatch --event Updated -0r mysitedir | xargs -0r -I{} echo {}

I found the answer here: https://stackoverflow.com/a/23030127/1011766

Because fswatch is a long-running process, I had to use sed's -u flag to unbuffer the stream.

-u, --unbuffered

       load minimal amounts of data from the input files and flush the output buffers more often

This simple fix did it:

fswatch -xr mysitedir | sed -un '/Updated$/p' | xargs -L1 -I {} echo {}

I found the answer here: https://stackoverflow.com/a/23030127/1011766

Because fswatch is a long-running process, I had to use sed's -u flag to unbuffer the stream.

-u, --unbuffered

       load minimal amounts of data from the input files and flush the output buffers more often

This simple fix did it:

fswatch -xr mysitedir | sed -un '/Updated$/p' | xargs -L1 -I {} echo {}


NOTE

Better solution from @cas for my specific use-case is to use fswatch's built-in --event flag:

fswatch --event Updated -0r mysitedir | xargs -0r -I{} echo {}
formatting
Source Link
JP Lew
  • 171
  • 7

I found the answer here: https://stackoverflow.com/a/23030127/1011766

Because fswatch is a long-running process, I had to use sed's -u flag to unbuffer the stream.

       -u, --unbuffered

              load minimal amounts of data from the input files and flush the output buffers more often

This simple fix did it:

fswatch -xr mysitedir | sed -un '/Updated$/p' | xargs -L1 -I {} echo {}

I found the answer here: https://stackoverflow.com/a/23030127/1011766

Because fswatch is a long-running process, I had to use sed's -u flag to unbuffer the stream.

       -u, --unbuffered

              load minimal amounts of data from the input files and flush the output buffers more often

This simple fix did it:

fswatch -xr mysitedir | sed -un '/Updated$/p' | xargs -L1 -I {} echo {}

I found the answer here: https://stackoverflow.com/a/23030127/1011766

Because fswatch is a long-running process, I had to use sed's -u flag to unbuffer the stream.

-u, --unbuffered

       load minimal amounts of data from the input files and flush the output buffers more often

This simple fix did it:

fswatch -xr mysitedir | sed -un '/Updated$/p' | xargs -L1 -I {} echo {}

Source Link
JP Lew
  • 171
  • 7

I found the answer here: https://stackoverflow.com/a/23030127/1011766

Because fswatch is a long-running process, I had to use sed's -u flag to unbuffer the stream.

       -u, --unbuffered

              load minimal amounts of data from the input files and flush the output buffers more often

This simple fix did it:

fswatch -xr mysitedir | sed -un '/Updated$/p' | xargs -L1 -I {} echo {}