inotifwait won't run command
"Setting up watches. Watches established" is output, script just exit
#!/bin/bash
while $(inotifywait -e modify,close_write /home/centos/test.txt);
do
touch /home/centos/log.txt
done
but when i modify test.txt log.txt is not created
Tried this version:
#!/bin/bash
inotifywait -e modify,close_write /home/centos/test.txt |
while read output; do
touch /home/centos/log.txt;
done
tried this also:
inotifywait -e modify,close_write /home/centos/test.txt |
while read -r filename event; do
echo "test" # or "./$filename"
done
Solved it by adding
-m /folder