I'm trying to run a program in docker, and once the program is successfully started, it creates a FIFO file in docker's file system, and writes a "success" string in it. I'm aware that if the file exists, I can stream the content of file by tail -f
, but this will always wait until I hit ctrl-c
on cli. And also, how to extend this case if the file has not been created yet?
I want to know if there's a shell command that I can wait till a file is being written non-empty string, and this file could have not existed while I start the wait. The wait will exit once it reaches a timeout.
Note that this command will be passed to a docker with docker exec -i myContainer the_desired_command...
.