Ben Dugan on 31 Oct 2006 20:01:49 -0000


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

[PLUG] Basic unix pipe question



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