I/O redirection using cygwin and mingw
Posted
by
KLee1
on Super User
See other posts from Super User
or by KLee1
Published on 2011-07-08T16:35:43Z
Indexed on
2012/11/23
23:07 UTC
Read the original article
Hit count: 215
I have written a program in C and have compiled it using MinGW. When I try to run that program in Cygwin, it seems to behave normally (i.e. prints correct output etc.)
However, I'm trying to pipe output to a program so that I can parse information from the program's output. However, the piping does not seem to be working in that I am not getting any input into the second program.
I have confirmed this by using the following commands:
This command seems to work fine:
./prog
Performing this command returns nothing:
./prog | cat
This command verifies the first:
./prog | wc
Which returns:
0 0 0
I know that the script (including the piping from the program) works perfectly fine in an all Linux environment.
Does anyone have any idea for why the piping isn't working in Cygwin? Thanks!
© Super User or respective owner