“cat-”在这个代码片段中意味着什么?

时间:2017-10-01 02:04:18

标签: cat

echo -n x | cat - pipe1 > pipe2 &
cat <pipe2 > pipe1

来自文章http://www.linuxjournal.com/article/2156

1 个答案:

答案 0 :(得分:0)

cat首先从stdin(-)生成“x”,然后生成任何名为pipe1的内容。

跟着第二只猫的命令非常狂野,因为“x”在两只猫之间反弹。 1997年的Vaught解释说:

  

这两个猫程序都像疯了一样疯狂地在无限循环中来回复制字母x。