1
awk - awk连接字符串变量
我想在awk中awk连接字符串变量。我怎样才能做到这一点?我试过了: BEGIN{ t="." r=";" w=t+r print w} 但我不工作。输出: 0 或者我想添加变量和函数的结果。输入: t t t t a t a ta ata ta a a 脚本: { key="t" print gsub(key,"")#<-it's work b=b+gsub(key,"")#<- it's something wrong } END{ print b}#<-so this is 0 输出: 4 2 2 0#<-the last print