Bob,

> the following should work:
> > QSH CMD('/qsys.lib/XXX.lib/producer.pgm |
> /qsys.lib/ZZZ.lib/consumer.pgm')

using;

/*--  PGMA --*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main( int argc, char **argv)
{
    fprintf( stdout, "Hello, here is some input for you :\n" );
    fprintf( stdout, "An input line of data number 1.....\n" );
    fprintf( stdout, "An input line of data number 2.....\n" );
    fprintf( stdout, "An input line of data number 3.....\n" );

    return 0;
}

and;

/*--  PGMB --*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main( int argc, char **argv)
{
    char buffer[200];

    fread( buffer, 144, 1, stdin );

    printf( "Echo:\n" );
    printf( "%s\n", buffer );

    return 0;
}

And the following QSH cmdline;

QSH CMD('/qsys.lib/phil_src@.lib/##s1.pgm |
/qsys.lib/phil_src@.lib/##s2.pgm')

Does create the correct behaviour/output of;

Echo:
Hello, here is some input for you :
An input line of data number 1.....
An input line of data number 2.....
An input line of data number 3.....
Press ENTER to end terminal session.

--phil


This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2019 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available here. If you have questions about this, please contact [javascript protected email address].