I have a simple question. I want to execute a C program in a shell script. How do I do that? Thanks for your help in advance.
Almost every program that you execute in a shell script is a C program (but some, often many, of the commands you execute may be built into the shell). You execute a C program in the same way as any other program:
command [arg1 ...]
./command [arg1 ...] or ../../bin/command [arg1 ...]
/some/directory/bin/command [arg1 ...]
One of the beauties of Unix is that programs you create, whether in C or any other language, attain the same status as the system-provided commands. The only difference is that the system-provided commands are in a different place (such as /bin or /usr/bin) from commands you create (such as usr/local/bin or $HOME/bin).