Closed azl397985856 closed 3 years ago
mkfifo pipe1
mkfifo pipe2
echo -n run | cat - pipe1 > pipe2 &
echo run
输入字符串 run
,-n
参数去除 trailing line|
pipe tocat - pipe1 > pipe2
将输入(run
) 和 pipe1(暂时没有内容) 的内容输入到 pipe2&
run in backgroundcat < pipe2 > pipe1
cat
命令的输入,然后再输出到 pipe1 中。一顿操作之后,pipe1 和 pipe2 中的内容都是 run
。
通过 google 之后猜的 ╮(╯▽╰)╭
新建两个命名管道pipe1, pipe2, 将两个管道两端接合,形成一个环,字符串在两个管道间不断拷贝。整挺好,就是死循环废机器。
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.