[Malvern] Streaming "C" progs.

Colin Newell colin.newell at gmail.com
Tue Mar 21 13:53:54 GMT 2006


It is not whether the program includes stdio.h that will indicate this
(although there is more chance if it is) but whether they output to
stdout or stderr.  If they output to stderr I am not sure if you can
use a pipe but you can use the > operator with the stream identified. 
I have a feeling that the exact syntax might be shell specific but a
concrete example would be,

$ valgrind ./myprog 2> errors.txt

This would redirect all of stderr to the file errors.txt.  I had a
feeling that there might be a program commonly included on nix that
allows you to redirect streams but I might have been thinking of tee
which is for a different purpose.


Colin

On 3/21/06, Andy Dixon <andy at andydixon.com> wrote:
>
> On 21 Mar 2006, at 12:50, Geoff Bagley wrote:
>
> > If "C" programmes contain the header stdio.h,  as I think most of
> > them do, then can you just
> > "pipe" the output of one to the next ?  E.g. :  ./prog1 | ./prog2
> > |  etc.  ?
> >
> > Geoff.
> >
>
> As long as the C program is sending output to STDOUT, you should be
> fine.
>
> Andy
>
> _______________________________________________
> Malvern mailing list
> Malvern at mailman.lug.org.uk
> http://mailman.lug.org.uk/mailman/listinfo/malvern
>



More information about the Malvern mailing list