I am calling a shell script from a \'c\' program and have some variables in c which I would like to pass as arguments to the shell script. I tried using the system() to call
This below program have worked for me
#include
#include
#include
#include
#include
int main(int argc, char const *argv[])
{
char buf[1000]; //change this length according to your arguments length
int i;
for (i=0;i
My Shell script had arguments like
sh shell-scriptname.sh -a x -b y -c z -d blah/blah/blah
I complied the C program using the following
gcc c-programname.c -o utility-name
To execute
./utility-name -a x -b y -c z -d blah/blah/blah
worked for me