azl397985856 / fe-interview

宇宙最强的前端面试指南 (https://lucifer.ren/fe-interview)
Apache License 2.0
2.83k stars 260 forks source link

【每日一题】- 2020-10-09 - 以下 shell 的作用是什么? #151

Closed azl397985856 closed 3 years ago

azl397985856 commented 3 years ago
mkfifo pipe1
mkfifo pipe2
echo -n run | cat - pipe1 > pipe2 &
cat <pipe2 > pipe1
suukii commented 3 years ago
mkfifo pipe1
mkfifo pipe2
echo -n run | cat - pipe1 > pipe2 &
cat < pipe2 > pipe1

一顿操作之后,pipe1 和 pipe2 中的内容都是 run

通过 google 之后猜的 ╮(╯▽╰)╭

feikerwu commented 3 years ago

新建两个命名管道pipe1, pipe2, 将两个管道两端接合,形成一个环,字符串在两个管道间不断拷贝。整挺好,就是死循环废机器。

stale[bot] commented 3 years ago

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.