I have around 1000 files where on each of them if the first field matches a specific number , i need to print the corresponding 3rd element . Since the number 7 below, is not constant and it based upon the output of previous script , when I am trying to pass a variable , it fails .
$cat ${i} | head -14 | awk '$1 == "7" {print $3}'
$Supervisor
$blah=7
$cat ${i} | head -14 | awk '$1 == "${blah}" {print $8}'
I have tried looking around with other combinations to escape/expand the variable inside the comparison , none of them seem to be able to expand the variable blah
.