How to call C functions in shell scripts?

How can i call dynamic C functions in shell scripts?

The question does not seem entirely well-defined. The normal way to use C code is to compile it into an executable. If you compile it into a shared libary, and have another (reasonably, C) application which can load a shared library and run an arbitrary function from that library, there you have it; but if I understand your question correctly, there is no standard solution to this problem (and indeed there hardly could be, as you cannot pass in arguments as native C types from the shell easily -- the abstraction levels are quite different).

Hi Era...

I meant to say was that there is a c program which contains some functions which are called during runtime. Now i am writing a shell script which uses these functions. So how can i call these functions in my shell script?

Thanks in advance.

You make your program such that you can tell it from the command line which function to run.

Another approach is to use ksh93 and load your functions from a shared libary into the shell via the builtin -f command. However there is a fairly steep learning curve with this approach.

Hi,

Please check the link below whether this is waht u are looking for

Thanks
Js