I am attempting to use a for loop to run command line arguments, I have never attempted this and I am having some trouble.
I am using the following commands:
for((a=1; a<20; a++));
do
./a.out -N 10000 -D .25*a -E 0.7788007831;
done
I am using the getopt function in c to read in values. I want to try different values of D (called Delta in the output). However when I run this command I get:
Acceptance rate is: 0.928400
Estimate is: 0.758704
Error is : 0.020097
Delta used: 0.250000
Acceptance rate is: 0.928400
Estimate is: 0.758704
Error is : 0.020097
Delta used: 0.250000
Acceptance rate is: 0.928400
Estimate is: 0.758704
Error is : 0.020097
Delta used: 0.250000
Acceptance rate is: 0.928400
Estimate is: 0.758704
Error is : 0.020097
Delta used: 0.250000
...
Acceptance rate is: 0.928400
Estimate is: 0.758704
Error is : 0.020097
Delta used: 0.250000
I'm not sure what the problem is though.
.25*a
versus turning it into a glob or ... ? – thrig Jan 02 '18 at 15:54