running [b]source script.sh[/b] inside a C code

view story

http://ubuntuforums.org – Hello, I understand that to run a shell-related command like history inside a shell script you should do either source script.sh or . ./script.sh, because otherwise it gives the history of the shell forked by the shell script, which is basically blank. But I would like to know how I can run this nside a C program. Normally I do system("./script.sh"). In this case I tried doing system("source script.sh") and system(". ./script.sh"). But neither of those seem to work. Please find below all the necessary files. my c code Code: #include <stdio.h> #include (Hardware)