- 论坛徽章:
- 5
|
本帖最后由 seanking1987 于 2016-06-27 14:10 编辑
回复 8# Herowinter
thanks,其实更准确的说我是想问为什么要 print xxoo,后来查了一下awk print和printf的区别,现在知道原因了。
The performance difference is probably not measurable.
The print function outputs a newline at the end; printf does not unless requested.
The print code converts the arguments to strings and then sends them to the output separated by the OFS (output field separator).
The printf code might need to convert the string to a double before formatting it using a double format (%16.8g or something), and similar operations.
The system call used is going to write(2) or something similar for both, but there'll be code (probably <stdio.h>) layered above that.
|
|