摘要: 格式 printf(format,value1,value2...) #awk '{printf("total pay for %s is $%.2f\n",$1,$2,$3)}' emp.data total pay for Beth is $4.00total pay for Dan is $3 阅读全文
posted @ 2018-07-12 11:20 夏天的西瓜君 阅读(259) 评论(0) 推荐(0) 编辑
摘要: 打印行号 # awk '{print NR,$0}' emp.data 1 Beth 4.00 02 Dan 3.75 03 Kathy 4.00 104 Mark 5.00 205 Mary 5.50 226 SUsie 4.25 18 打印列数 # awk '{print NF,$0}' emp 阅读全文
posted @ 2018-07-12 10:23 夏天的西瓜君 阅读(1353) 评论(0) 推荐(0) 编辑