Defining variable
awk -v var1="Hello" -v var2="Wold" '
END {print var1, var2}
' </dev/null
#Use shell variables
awk -v varName="$PWD" '
END {print varName}' </dev/null
Comments
awk -v var1="Hello" -v var2="Wold" '
END {print var1, var2}
' </dev/null
awk -v varName="$PWD" '
END {print varName}' </dev/null