BASH 命名管道锁定
我不明白为什么会发生这种情况。我已经使用同一个命令很长时间了,现在突然它开始锁定。
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我遇到了同样的问题,同样...呵呵...思维错误...
我在这里解决了我的问题,并发现 一篇关于命名管道的优秀文章 我想与每个想要“正确”使用命名馅饼的人分享。
不要忘记阅读评论;)
享受吧!
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 !
从 FIFO 读取。
Read from the FIFO.
它没有被锁起来。它正在等待从管道中读取数据。 在另一个窗口中执行
,它将打印出您放入管道中的
test
字符串,然后您的echo
将退出。It's not locked up. It's waiting for something to read from the pipe. Execute
in another window, and it will print out the
test
string you put into the pipe, and then yourecho
will exit.