You would have to turn fun1 into a program with a main(), compile it, then call that compiled program from your Korn shell script. How you turn it into a complete C program depends on what the function does.
For example, if your function just adds two numbers and looks like...
[tt]
int fun1(int a, int b)
{
return (a+b);
}
[/tt]
Then to turn it into a complete program, you would do something like...
[tt]
#include <stdio.h>
int main(int argc, char ** argv)
{
printf("%d", fun1(argv[1], argv[2]) );
exit(0);
}
[/tt]
(Note that there is NO error handling in this example!!!) Compile and link it with your fun1() function. Name the compiled program fun1. Then you can call it from a shell script like...
[tt]
VAR1=23
VAR2=45
ADDEDVAR=`fun1 ${VAR1} ${VAR2}`
[/tt]
This is just a very simple example. How you write the C program to be called from a shell script will vary greatly depending on what the function does!
Hope this helps.