Hi,
I have searched the forum for the query, But i didnt find an exact answer.
I have a script(1.sh) and a c program(sample.c)
sample.c contains many function definitions.( run(), find(), add() etc).
I want to call functions in sample.c from 1.sh and use the return value in 1.sh
********************
1.sh
echo "this is sample"
.....
.....
find("nomber")
....
....
*********************
Thanks,
Am came to know about the same. But is their any way to implement my need?.I mean any way to make this work out with out using perl or python or anything else, but by just using shell and c ???
Thaknks in advance
Js
void pline(void)
{
int i;
for(i=1;i<5;i++)
printf("Test \n");
printf("\n");
}
Now save the sample.c and execute it so that we get the .exe file
The command for this is :
gcc -o sample.exe sample.c
Now this will give us sample.exe file
Now open the 1.sh
echo " test script to call the c function"
sample.exe pline
save the script and execute it !!!!
Note that either we have to include the patch of sample.exe in the $PATH (environment variable) or give the complete path of sample.exe in the example script as below:
echo " test script to call the c function"
/home/name/script/sample.exe pline