当我尝试重定向cut
它的输出时,它似乎总是为空。如果不重定向它,输出将按预期显示在终端中。这适用于 OS X 10.10 和 Linux 4.1.6。
这有效:
root@karla:~# nc 10.0.2.56 30003
[...] lots of lines [...]
Run Code Online (Sandbox Code Playgroud)
这有效:
root@karla:~# nc 10.0.2.56 30003 | cat
[...] lots of lines [...]
Run Code Online (Sandbox Code Playgroud)
这有效:
root@karla:~# nc 10.0.2.56 30003 | cut -d, -f 15,16
[...] lots of lines [...]
Run Code Online (Sandbox Code Playgroud)
这不
root@karla:~# nc 10.0.2.56 30003 | cut -d, -f 15,16 | cat
[nothing]
Run Code Online (Sandbox Code Playgroud)
这再次DOES
root@karla:~# cat messung1 | cut -d, -f15,16 | cat
[...] lots of lines [...]
Run Code Online (Sandbox Code Playgroud)
这不仅限于cat
之后cut
。 …