I run my program prog.c in the following way :
$ ./prog 1 > output.txt
where 1 is a user defined initial value used by the program.
But now I want to run it for many a thousand initial values, 1-1000, and store all the outputs in different files.
$ ./prog 1 > output1.txt $ ./prog 2 > output2.txt $ ./prog 3 > output3.txt . . $ ./prog 1000 > output1000.txt
I know how to use the for loop in a shell script but dont know how to give a variable output name.
Please give me a small example