• spawnp() function

    From Marco Franchini@marco.franchini.it@gmail.com to comp.sys.ibm.as400.misc on Thu Oct 17 09:27:22 2019
    From Newsgroup: comp.sys.ibm.as400.misc

    I normally use spawnp() function in ILE C to execure programs that reside in QSYS.LIB and have a link in a directory included in $PATH and it works fine;
    now I'm trying to execute, always using spawnp, a shell script (using qsh interpreter) but it not work and does not produce any results.
    Can someone give me a suggestion ?

    Thanks
    Marco
    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From Jonathan Bailey@jonathan.bailey@tesco.net to comp.sys.ibm.as400.misc on Fri Oct 18 05:16:25 2019
    From Newsgroup: comp.sys.ibm.as400.misc

    I dont know spawnnp so well.
    Examples of working vs non working would help.
    If spawnp takes a program as you imply and you are passing "QSH scriptname" then I might expect your error is 'no such program as QSH. dspcmd qsh takes you via qshell library to program QSHELL/QZSHQSHC.
    Maybe you need to embed the qsh command in a call to qcmdexc?

    HTH
    Jonathan

    On Thursday, 17 October 2019 17:27:24 UTC+1, Marco Franchini wrote:
    I normally use spawnp() function in ILE C to execure programs that reside in QSYS.LIB and have a link in a directory included in $PATH and it works fine;
    now I'm trying to execute, always using spawnp, a shell script (using qsh interpreter) but it not work and does not produce any results.
    Can someone give me a suggestion ?

    Thanks
    Marco

    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From Marco Franchini@marco.franchini.it@gmail.com to comp.sys.ibm.as400.misc on Fri Oct 18 09:11:15 2019
    From Newsgroup: comp.sys.ibm.as400.misc

    spawnp() work different from QSH (or QSHELL/QZSHQSHC program);
    this function creates a child process that inherits specific attributes from the parent and it uses the PATH environment variable to resolve relative filenames.
    It work fine with symbolic link program but non work with shell script.
    Il giorno venerd|4 18 ottobre 2019 14:16:28 UTC+2, Jonathan Bailey ha scritto:
    I dont know spawnnp so well.
    Examples of working vs non working would help.
    If spawnp takes a program as you imply and you are passing "QSH scriptname" then I might expect your error is 'no such program as QSH. dspcmd qsh takes you via qshell library to program QSHELL/QZSHQSHC.
    Maybe you need to embed the qsh command in a call to qcmdexc?

    HTH
    Jonathan

    On Thursday, 17 October 2019 17:27:24 UTC+1, Marco Franchini wrote:
    I normally use spawnp() function in ILE C to execure programs that reside in QSYS.LIB and have a link in a directory included in $PATH and it works fine;
    now I'm trying to execute, always using spawnp, a shell script (using qsh interpreter) but it not work and does not produce any results.
    Can someone give me a suggestion ?

    Thanks
    Marco
    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From Jonathan Bailey@jonathan.bailey@tesco.net to comp.sys.ibm.as400.misc on Mon Oct 21 06:07:18 2019
    From Newsgroup: comp.sys.ibm.as400.misc

    On Friday, 18 October 2019 17:11:18 UTC+1, Marco Franchini wrote:
    spawnp() work different from QSH (or QSHELL/QZSHQSHC program);
    this function creates a child process that inherits specific attributes from the parent and it uses the PATH environment variable to resolve relative filenames.
    It work fine with symbolic link program but non work with shell script.


    Il giorno venerd|4 18 ottobre 2019 14:16:28 UTC+2, Jonathan Bailey ha scritto:
    I dont know spawnnp so well.
    Examples of working vs non working would help.
    If spawnp takes a program as you imply and you are passing "QSH scriptname" then I might expect your error is 'no such program as QSH. dspcmd qsh takes you via qshell library to program QSHELL/QZSHQSHC.
    Maybe you need to embed the qsh command in a call to qcmdexc?

    HTH
    Jonathan

    On Thursday, 17 October 2019 17:27:24 UTC+1, Marco Franchini wrote:
    I normally use spawnp() function in ILE C to execure programs that reside in QSYS.LIB and have a link in a directory included in $PATH and it works fine;
    now I'm trying to execute, always using spawnp, a shell script (using qsh interpreter) but it not work and does not produce any results.
    Can someone give me a suggestion ?

    Thanks
    Marco
    Sorry, I cant offer any further ideas without some examples.
    Jonathan
    --- Synchronet 3.21d-Linux NewsLink 1.2