I have written a program in C that requires four floating point variables to be passed to it as parameters. I would like to make a script that will run this program x times, with those four variables being decreased by a certain amount each time before the program is executed again.
Batch and bash don't support floating point numbers, but bc supports arbitrary precision which you can use in a bash script. I should say I haven't done any scripting before, except for a recent batch script which led me to realise batch wasn't suitable.
Being a relative noob in this area, my Googling and searching hasn't found anything particularly useful to me, so here I am.
Here is basically what I want:
MINX=-2.0
MAXX=0.8
MINY=-1.4
MAXY=1.4
for X times
{
myprogram minX maxX minY maxY
MINX-=0.1
MAXX-=0.1
MINY-=0.1
MAXY-=0.1
}
So I want to run the program with the initial variables set, then decrement those variables and run the program again, and so on..
Everything I have found so far to do with floating point variables in bash + bc, I just can't seem to get to grips with it, so I'm hoping if I explain what I want to accomplish, one of you good people will be able to explain :)
Thanks in advance.