📅  最后修改于: 2022-03-11 14:51:35.235000             🧑  作者: Mango
# Example usage (one variable):
variable="one shell\nvariable"
awk -v var="$variable" 'BEGIN {print var}'
--> one shell
--> variable
# Example usage (multiple variables):
var1="multiple"
var2="shell"
var3="variables"
awk -v a="$var1" -v b="$var2" -v c="$var3" 'BEGIN {print a,b,c}'
--> multiple shell variables