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
SNDPIPE
-
- Site Admin
- Posts: 799
- Joined: Sun Jul 04, 2021 5:12 am
Re: SNDPIPE
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:
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)