Hi all

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.
Like

$ ./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
PLEASE HELP

Regards
Alice

x=1
while [ $x -le 10 ]
do
  echo $x
  x=$((x + 1 ))
done
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.