x=3
A=`echo $A|awk '{print $x}'`
echo $A
doesnt print 3. How can i use variables with awk*
Pass variables to awk
with the -v
flag.
x=3
A=`echo $A|awk -v y=$x '{print y}'`
echo $A
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With