I am designing an C++ app that, among other things, executes a few scripts every now and then. The app should be efficient and preferably platform independent.
The i
Whatever command you want to execute just store that in a file c.txt. Pass that file to the execl() like as done below.
execl()
fd = open("c.txt", O_CREAT | O_RDWR, 00777); write(fd,arr,sizeof(arr)); if(fork() == 0) { execl("/bin/sh", "sh", "-c","sh c.txt", (char *) 0); }