Run sequential test files

I have c program that I run like this:

./a.out t1

And my test files look like this all the way up to 100:

t1
t2
t3

Is there a way to run this more efficiently so I don't have to hit up and change the number every time?

How about using a for or a while loop?

I would I do that? I'm not very good with shellscripts.

Hi,

Try this;

for i in `ls t*`
do 
a.out ${i}
done

Regards

Gull04

1 Like

You don't even need the command substitution:

for i in t*
  do  a.out ${i}
  done