I have an application called A
that receives an input n
and runs for some time before returning the answer.
I would like to execute A
for increasing sizes of n
with the following simple bash script:
#!/bin/sh
time ./A 10
time ./A 20
time ./A 30
.
.
.
However I need something very important as well. If a time
call takes too long to execute, because the input is large, then I need the entire bash script to stop running.
Is there an easy way of doing this?