SNDPIPE

Other open source tools published on ScottKlement.com
Post Reply
daveslater1964
Posts: 4
Joined: Tue Feb 06, 2024 3:39 pm

SNDPIPE

Post 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
Scott Klement
Site Admin
Posts: 799
Joined: Sun Jul 04, 2021 5:12 am

Re: SNDPIPE

Post 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)
Post Reply