Can someone tell me how I can use a variable as the parameter to a print startement? e.g.
VAR=7
echo $LINE | awk '{ print ??? }'
I want to print the 7th field in $LINE (but next time $VAR will have a different value). I've tried all the variations of dollar signs & brackets that I can think of but I either get the whole of $LINE or a syntax error.
TIA, Chris
VAR=7
echo $LINE | awk '{ print ??? }'
I want to print the 7th field in $LINE (but next time $VAR will have a different value). I've tried all the variations of dollar signs & brackets that I can think of but I either get the whole of $LINE or a syntax error.
TIA, Chris