i'm trying to read from a file "file", with a for loop before the awk, so the "$j" would refer to the j variable in the loop, now i'm trying to get the first field on that file using awk, so i tried using $$j, but it gets translated into process id because of the two dollar signs in row, how can i avoid this?
this is the code
for ((j = 1; j < $number_of_insertion_col; j++)); do
var=$(awk -F"\t:\t" 'NR==1 {print "'$$j'" }' file)
done
sample input
"col1(pk) : col2 : col3 : "
my desired output is "col1(pk) in the firs iteration, then col2 in the second and so on and so forth