I want to print $2
however inside a for loop. I tried with the following
for i in {2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,21}; do
awk '{ print $${i} }' COLVAR >tmp_${i}
done
It gives syntax error. I tried also with ${${i}}
but still the syntax error. I am not sure what is wrong.