开发者

Executing linux commands with c

开发者 https://www.devze.com 2023-02-15 00:17 出处:网络
Is there any way to execu开发者_如何学Cte Linux commands with c without using execlp(), like predefined functions or something else.

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, ...).

0

精彩评论

暂无评论...
验证码 换一张
取 消