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.
Use awk's system() function:
Here an example
awk '{printf("%s ",$1); system("myscript " $2)}' file
the example is from this site https://unix.stackexchange.com/questions/72935/using-bash-shell-function-inside-awk