inotifwait不会运行命令
输出"Setting up watches. Watches established“,脚本退出
#!/bin/bash
while $(inotifywait -e modify,close_write /home/centos/test.txt);
do
touch /home/centos/log.txt
done但当我修改test.txt时,并未创建log.txt
我试过这个版本:
#!/bin/bash
inotifywait -e modify,close_write /home/centos/test.txt |
while read output; do
touch /home/centos/log.txt;
done我也试过了:
inotifywait -e modify,close_write /home/centos/test.txt |
while read -r filename event; do
echo "test" # or "./$filename"
done发布于 2018-10-03 17:32:22
通过添加-m /folder解决了这个问题
https://stackoverflow.com/questions/52623306
复制相似问题