jeudi 10 décembre 2020

awk while loop doesn't run ./myscript

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");
}
}
} ' 

Whene I run this code it gives me the result of the two first lines only (./rand_input_generator and ./myscrpit) It seems like it doesn't go into a loop at all. any suggestions please?

Aucun commentaire:

Enregistrer un commentaire