Executing linux commands with c
Is there any way to execu开发者_如何学Cte Linux commands with c without using execlp()
, like predefined functions or something else.
Thanks.
Use system()
or popen()
if you need the commands output.
system(const char *command);
sounds to be what you want
You can use system
. It execute the command, but take care since it invoke a shell to interpret the command (breaking argument list on space, ...).
精彩评论