I'm using shell command in redhat ubi-minimal. I want to monitor a file "./hello.txt", which does not exist yet. I want to use inotifywait to monitor this file, and wait until either ./hello.txt is created and being written some non-empty content in it, or a fixed timeout.
Following inotifywait's man page, I tried:
inotifywait -m -e create -r --fromfile ./hello.txt -t 30
with -m -e create specifying that this command executes indefinitely until create occur.
But it only gives:
Couldn't open ./hello.txt: No such file or directory
No files specified to watch!
I wonder how to specify the flags of inotifywait to achieve what I'm expecting.