inotifywait not working 1

inotifywait not working

#!/bin/bash

while read line
do
    echo "close_write: $line"
done < <(inotifywait -mr -e close_write "/tmp/test/")

Here is what the above code is Doing:
1. The while loop is reading from the inotifywait command.
2. The inotifywait command is watching the /tmp/test/ directory for close_write events.
3. The inotifywait command is running in the background.
4. The while loop is printing the output of the inotifywait command.
5. The inotifywait command is running in the background.

Similar Posts