Using awk with variables July 12, 2022 by Tarik Pass variables to awk with the -v flag. x=3 A=`echo $A|awk -v y=$x '{print y}'` echo $A