• spawnp() function

    From Marco Franchini@21:1/5 to All on Thu Oct 17 09:27:22 2019
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jonathan Bailey@21:1/5 to Marco Franchini on Fri Oct 18 05:16:25 2019
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Marco Franchini@21:1/5 to All on Fri Oct 18 09:11:15 2019
    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ì 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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jonathan Bailey@21:1/5 to Marco Franchini on Mon Oct 21 06:07:18 2019
    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ì 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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)