
how to call a unix shell script from a c program
Quote:
> Anyone out there is willing to shed some light on how to call a Unix shell
> script for a c program. Thanks in advance.
Hi Marin Lazar,
You can send a string to the command processor of the underlying
operating system by using the "system()" function. If you want to
build the string from variable components, use the "sprintf()"
function to assemble it before calling "sustem()":
sprintf( myCommand, "someProgOrScript %s %d", someString, someNumber
);
system( myCommand );
Stephan
(initiator of the campaign against grumpiness in c.l.c)