teddysun / across

Across the Great Wall we can reach every corner in the world
https://teddysun.com
Apache License 2.0
4.99k stars 2.23k forks source link

Modify `io_test` to adapt to the Chinese environment #124

Closed seamile closed 5 months ago

seamile commented 5 months ago

When the system environment is Chinese, io_test() will throw an error. Therefore, in io_test(), we need to let awk use both Chinese and English commas as delimiters.

The error like this:

 I/O Speed(1st run) : 1073741824字节(1.1 GB,1.0 GiB)已复制,2.26661 s,474 MB/s
 I/O Speed(2nd run) : 1073741824字节(1.1 GB,1.0 GiB)已复制,2.22526 s,483 MB/s
 I/O Speed(3rd run) : 1073741824字节(1.1 GB,1.0 GiB)已复制,2.02646 s,530 MB/s
awk: 命令行:1: BEGIN{print 1073741824字节(1.1 + 1073741824字节(1.1 + 1073741824字节(1.1}
awk: 命令行:1:                       ^ 表达式中的无效字符“
awk: 命令行:1: BEGIN{print 1073741824字节(1.1 + 1073741824字节(1.1 + 1073741824字节(1.1}
awk: 命令行:1:                       ^ syntax error
awk: 命令行:1: BEGIN{printf "%.1f",  / 3}
awk: 命令行:1:                        ^ 未终止的正则表达式
awk: 命令行:1: BEGIN{printf "%.1f",  / 3}
awk: 命令行:1:                           ^ 未预期的新行或字符串结束
 I/O Speed(average) :  MB/s
teddysun commented 5 months ago

Thanks & Merged