how to call unix shell scripts from with in 'C' code?

R

Ryan Gaffuri

Ill also need to return values. How do I do this? Im using GNU on
solaris 2.8 with korn shell scripts?
 
C

Christopher Benson-Manica

Ryan Gaffuri said:
Ill also need to return values. How do I do this? Im using GNU on
solaris 2.8 with korn shell scripts?

system( "path-to-script-here" ); /* this returns a value - use it */
 
D

Default User

Christopher said:
system( "path-to-script-here" ); /* this returns a value - use it */


However, that return value is implementation-specific.


[#3] If the argument is a null pointer, the system function
returns nonzero only if a command processor is available.
If the argument is not a null pointer, and the system
function does return, it returns an implementation-defined
value.


The OP would be best to check his documentation, or ask this question on
gnu.gcc.help or possibly on comp.unix.programmer (assuming there's a
standard unix form of the return value, I think so).



Brian Rodenborn
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top