I would like to run a script within an awk command. I have a code ./myscript that calculates the likelihood between two entities; the results are listed in listfile.txt.
The input for ./myscript is a file with two columns generated randomly.
The purpose here is to know what input file (values) is the best for the calculation. If the condition (0.01<$8<0.5) is not verified, the code keep running until it gives the best (random input)
I did try this, but it doesn't keep executing the code
./rand_input_generator
./myscript
rms=` awk ' NR==1 {print $8}' listfile.txt`
echo $rms
awk 'BEGIN {
rrr=$rms;
min=0.01;
max=0.5;
while(rrr > max) {
while(rrr < min) {
system("./rand_input_generator");
system("./myscript.cmd");
}
}
} '
I seems like it doesn't go into a loop at all. any suggestions please?