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
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
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
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 293 |
Nodes: | 16 (2 / 14) |
Uptime: | 239:03:07 |
Calls: | 6,624 |
Files: | 12,172 |
Messages: | 5,319,990 |