I currently have a loop this way (working perfectly):
while true; do /usr/bin/R_START; sleep 0.1; done
The script "R_START" uses the lines of a text file named "FILE.TXT", they are deleted as soon as the script executes its instructions. I wonder if it is possible to cause the "R_START" loop to be interrupted when the "FILE.TXT" file is less than 3 lines without the need for Ctrl+C.
My biggest problem is that I need to run other "3 loops" similar to this, but I am "forced" to give Ctrl+C so I can execute the next loop.
Here's an example of what I have to do manually: Firstly I execute:
while true; do /usr/bin/R_START; sleep 0.1; done
It shows some error messages when there are no more than 3 lines in the FILE.TXT file. That's when I give Ctrl+C and continue to execute the next loop:
while true; do /usr/bin/R_20; sleep 0.1; done
It does basically the same as the first loop, and uses the same file "FILE.TXT". I see that it concluded when it shows some error messages when there are no more than 3 lines in the file "FILE.TXT". This is where I give Ctrl+C and continue executing the next loop (the next one in this case will be exactly the same):
It does basically the same as the first loop, and uses the same file "FILE.TXT". I see that it concluded when it shows some error messages when there are no more than 3 lines in the file "FILE.TXT". This is where I give Ctrl+C" and continue executing the next loop (the next one in this case will be exactly the same):
while true; do /usr/bin/R_20; sleep 0.1; done
After it completes (when it shows the same message of all because it does not have more than 3 lines in the file FILE.TXT) I give Ctrl+C and I manually continue to the last loop:
while true; do /usr/bin/R_30; sleep 0.1; done
The last one does exactly the same as the previous ones and I also have to give Ctrl+C after it gives the error message due to not having more than 3 lines in the file "FILE.TXT".
There would be a way to "automate" these loops: R_START, R_20 (2x), and R_30?