结果:
$ ./read_file.sh mylist.txt
Starting File Processing of each Method
Method 1:
function while_read_LINE
0.58s real 0.20s user 0.48s system
Method 2:
function while_read_LINE_bottom
0.03s real 0.00s user 0.03s system
Method 3:
function while_line_LINE_bottom
4.41s real 0.17s user 0.40s system
Method 4:
function cat_while_LINE_line
4.55s real 6.94s user 3.21s system
Method 5:
function while_line_LINE
4.48s real 6.53s user 3.29s system
Method 6:
function while_LINE_line_bottom
4.28s real 0.23s user 0.40s system
Method 7:
function while_LINE_line_cmdsub2
4.57s real 6.73s user 3.10s system
Method 8:
function while_LINE_line_bottom_cmdsub2
4.47s real 0.17s user 0.40s system
Method 9:
function while_read_LINE_FD
0.02s real 0.01s user 0.01s system
Method 10:
function while_LINE_line_FD
4.30s real 0.21s user 0.49s system
Method 11:
function while_LINE_line_cmdsub2_FD
4.37s real 0.10s user 0.53s system
Method 12:
function while_line_LINE_FD
4.25s real 0.10s user 0.49s system