I have written a loop to iterate all .out
c binary file and copy their outputs into a text file (the output for every binary file is just a one line hash value, one line output for one program). Here is my code so far:
for j in {1..10}
do
./gcc-$j.out >> gcc-result.txt
done
Unfortunately, some binary files have some unknown issues and cannot be correctly executed (they got stuck and cannot proceed to the next program).
I am not going to fix those c code but I want my bash to automatically jump to executing the next program within a given timeout (say 10 secs), and also write "0" to the gcc-result.txt
.
Thanks in advance if you have idea to solve this issue.