Using awk I have written this script but it’s not working properly. Even I expected just only specific column it’s displaying me total column of information.
n=0
echo "Enter which column you want: "
read n
awk '{print $($n)}' out.txt
I would like to have only specific column for the value of n.
Thank you
There is no parameter substitution within single quotes. Use
or use an awk variable as in