I am trying to do this
#!/bin/bash
for i in 1 2 3 4 5; do
File1="$i.txt"
File2="$i.obj"
./Test $File1 $File2
#save i and the result of the program somehow
done;
For example, at the end I would like to have a file like this
1 3.4
2 4.55
3 56.0
4 22.3
5 8.9
Where the second column is the "output" of the c++ program. The problem is the program has other outputs, ie
Starting program....
Doing stuff ....
3.4
Anyone ever wrap a program in a loop like this before and care about saving the output?
Thanks,
Dave