Morgan on 31 Oct 2006 20:15:45 -0000


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Basic unix pipe question


Ben,

Unless I am misunderstanding your question, this is just basic UNIX plumbing: the program being piped to will not even start I don't think until the first is finished.

-morgan




Ben Dugan wrote:

I'm confused by what is probably normal behavior:


[~]# program1 | program2


I don't get any output (on stdout) from program2 until program1 finishes. (I'm trying this out with simple C programs; program1 does a printf once every second, while program2 just watches stdin using fscanf and copies its stdin to stdout.)

I've been googling and looking at some reference books I have, but I
can't really figure out why this is. I can't coerce program2's output to
happen sooner using flush, either.

Any suggestions or explanations?

Thanks in advance.

Ben




___________________________________________________________________________ Philadelphia Linux Users Group -- http://www.phillylinux.org Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce General Discussion -- http://lists.phillylinux.org/mailman/listinfo/plug
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug