Linux中基于管道的程序 [英] Program based on pipe in Linux

查看:95
本文介绍了Linux中基于管道的程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为此编写程序------ >>>>>>

Write a program for this------>>>>>>

  • 一个程序将打开一个管道,在管道中写入一个数字.
  • 其他程序将打开同一管道,读取该编号并打印出来.
  • 关闭两个管道.

我如何基于任何人都知道的内容来编写程序,然后请帮助我... !!!!

how can i write a program based on this any one knows it then please help me...!!!!

推荐答案

我认为您正在寻找的是:

I think what you're looking for is:

echo <number you want to use> (or output from program) | <program you want to pipe into>

例如:

echo 5 | more

将仅显示:

5

"|"是你的烟斗吗?它将连接其标准流的输出从左向右重定向,该流通常不包括stderr.

The "|" is your pipe; it redirects output from the left to the right connecting their standard streams, which usually does not include stderr.

希望有帮助.

这篇关于Linux中基于管道的程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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