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").
I have a shell script on a remote Server X that i need to execute from Server A. the script executes fine locally but remotely does not. It appears the script on the remote machine is calling another shell script which only has an array defined . Please see below the errors.