printf和print
$ df -h | grep "/dev/sd.." | awk '{print $5}'
12%
1%
$ df -h | grep "/dev/sd.." | awk '{printf $5"\n"}'
awk: run time error: not enough arguments passed to printf("12% ") FILENAME="-" FNR=1 NR=1
哪里错了? 不是一样吗
$ df -h | grep "/dev/sd.." | awk '{print $5}'
12%
1%
$ df -h | grep "/dev/sd.." | awk '{printf $5"\n"}'
awk: run time error: not enough arguments passed to printf("12% ") FILENAME="-" FNR=1 NR=1
哪里错了? 不是一样吗
2016-04-24
举报