How do I launch a new non-interactive shell process from C?
Currently I have the following:
system(cmdStr);
//system("/bin/sh -c");
The cmdStr is the command I want to execute. I have the reference below to the shell process… but how do I append the cmdStr to it? How do I make it launch a new process?
If you don’t want to concatenate the string, you can do:
which is what
systembasically does.Otherwise to a concatenate a string, you should have a look to standard functions
strcatandstrncatfromstring.h.