Page 1 of 1

SNDPIPE

Posted: Thu Mar 28, 2024 3:02 pm
by daveslater1964
I am trying to use the sndpipe to add additional unix commands The commands don't appear to run
Simple CL program

Opnpipe cmd('PATH=$PATH:/QOpenSys/pkgs/bin')

sndpipe rcd('curl -help')

rcvpipe rcd(&rec) eof(&eof)

but I am not getting any response

but if I use
Opnpipe cmd('PATH=$PATH:/QOpenSys/pkgs/bin; curl -help')
on the rcvpipe I get the curl help text

Any help would be much appreciated

Re: SNDPIPE

Posted: Thu Mar 28, 2024 5:13 pm
by Scott Klement
You are attempting to run "PATH=$PATH:/QOpenSys/pkgs/bin" as if it is a program, and then send it a string that says "curl -help". Seems to me that this is correct behavior, you should receive nothing, since setting the PATH variable is not a program, and therefore sending data to it makes no sense.

What you are doing would be (approximately) equvalent to doing this in CL:

Code: Select all

  /* This makes no sense,  but is what you are asking it to do */
  CALL PGM(CHGVAR &PATH VALUE('xxx')) PARM(MYPGMNAME)