Artificial intelligent assistant

No output from inotifywait | awk I'm attempting to use part of a one-liner found here: Script to monitor folder for new files? When I try the following procedure I get no output whatsoever and I cannot figure out why. In terminal 1: inotifywait -m ~/somefolder | awk '{ print $3; fflush() }' Then in terminal 2: touch ~/somefolder/newfile When not piping to awk, inotifywait lists all the expected events to stdout and has no problem redirecting to a file either. Awk also appears to work correctly independent of inotifywait on text piped to it structured like the output of inotifywait. Using the two together just doesn't work for me. EDIT: awk was an alias for mawk on my machine which didn't work. gawk, however, came through and worked as expected.

As you have found out, `mawk` buffers its input, so you would probably see effects once your total notify messages have reached some k. The linked article suggests that mawk has a `-Winteractive` flag to disable it, but I am in position to check that.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 8aa5674a5961b9d8f2b50ceef4de0a59