BASH 命名管道锁定

发布于 2024-10-01 08:17:12 字数 134 浏览 1 评论 0原文

我不明白为什么会发生这种情况。我已经使用同一个命令很长时间了,现在突然它开始锁定。

mkfifo ./pipe
echo "test" >./pipe

我该怎么做才能阻止它被锁定?

I don't understand why this is happening. I've been working with this same command for a long time and now, suddenly, it's started locking up.

mkfifo ./pipe
echo "test" >./pipe

What can I do to stop this from locking up?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

迎风吟唱 2024-10-08 08:17:13

我遇到了同样的问题,同样...呵呵...思维错误...

我在这里解决了我的问题,并发现 一篇关于命名管道的优秀文章 我想与每个想要“正确”使用命名馅饼的人分享。

不要忘记阅读评论;)

享受吧!

I was having the same problem, and the same... huh... thinking error...

I solved my problem here, and discovered An excellent article about named pipes I wanted to share with everybody wanting to use "rightly" named pies.

Don't forget to read the comments ;)

Enjoy !

殊姿 2024-10-08 08:17:12

从 FIFO 读取。

Read from the FIFO.

注定孤独终老 2024-10-08 08:17:12

它没有被锁起来。它正在等待从管道中读取数据。 在另一个窗口中执行

cat < ./pipe

,它将打印出您放入管道中的 test 字符串,然后您的 echo 将退出。

It's not locked up. It's waiting for something to read from the pipe. Execute

cat < ./pipe

in another window, and it will print out the test string you put into the pipe, and then your echo will exit.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文