mkfifo导致终端挂? [英] mkfifo causes terminal to hang?

查看:158
本文介绍了mkfifo导致终端挂?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

mkfifo 根本不能使用Cygwin吗?一组简单的命令,如

  $ mkfifo my_pipe 

$ echo1234> my_pipe

只会导致终端永远停留在光标闪烁的状态。

解决方案

不,不会发生任何错误

$ p
$ b $ p

你缺少的是那些管道的另一端 ,读取该数据。这个明显的挂起发生在Linux中,所以它不是一个CygWin问题(或任何类型的问题,真的)。



只要打开另一个窗口并输入:

  cat< my_pipe 

,您将看到数据显示,然后是原始 echo 完成。


Does mkfifo simply not work with Cygwin? A simple set of commands such as

$ mkfifo my_pipe

$ echo "1234" > my_pipe

just causes the terminal to sit forever with the cursor blinking. Am I "doing it wrong"?

解决方案

No, you're not doing anything wrong with either of those commands, it's just your expectations are a little off.

What you're missing is something at the other end of that pipe, reading that data. This apparent hanging happens in Linux as well, so it's not a CygWin problem (or any sort of problem, really).

Just open up another window and enter:

cat <my_pipe

and you'll see the data appear, followed by the original echo completing.

这篇关于mkfifo导致终端挂?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆