• Post Reply Bookmark Topic Watch Topic
  • New Topic

implementing pipes in linux  RSS feed

 
ravindra koranga
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to implement pipes in linux through my own program. Here is my code :


The pipe works fine but. But when I run the program as ./pipe ls | wc , the elements of argv are not printed for which code is written in the beginning. Why aren't those lines giving any output?
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Perhaps it would be better to tell us exactly what you are getting, and what you are expecting.

Henry
 
ravindra koranga
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for your interest, but i got the answer. In the argument I was not supposed to use the '|' symbol. So shell redirects the output when it sees | symbol. the correct way to run it is by skipping the | symbol as : ./pipe ls wc
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!