相关疑难解决方法(0)

无法重定向剪切输出

当我尝试重定向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。 …

bash io-redirection cut netcat

4
推荐指数
1
解决办法
2354
查看次数

标签 统计

bash ×1

cut ×1

io-redirection ×1

netcat ×1