Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想将 printf 输出存储到数组中,如下所示:
op[i] = system( "printf \"%d\\n\" \"" SQ substr($1,i,1) "\"" )
但是当我给他们回电话时,他们只是0?!
你知道为什么吗!?
你要
op[i] = sprintf("%d\n", SQ substr($1,i,1))
从外部命令捕获输出的方法:
cmd = "date" cmd | getline output close(cmd)
http://www.gnu.org/software/gawk/manual/html_node/Getline_002fVariable_002fPipe.html#Getline_002fVariable_002fPipe