I have the following loop:
while inotifywait -qq --event close_write "$filebs" "$filevp"; do
do_something()
done
The problem is that, at certain times, two events are triggered one right after the other, so that while the code is do_something()
the first event, the second event is triggered.
Now, I'm fine with processing both events, and I'm fine with processing just the second event. But I'm not fine with processing just the first event.
How can I process them both?
I guess I need to print the events in a buffer, for e.g. with inotifywatch
, and read from that buffer?