如何从C执行bash命令?
发布时间:2020-12-16 03:27:40 所属栏目:百科 来源:网络整理
导读:这个问题在这里已经有一个答案: How to execute a shell script from C in Linux?6 有没有办法运行命令行实用程序,例如gzip,进入C应用程序? 解决方法 使用 system() : #include stdlib.hint status = system("gzip foo"); 有关如何使用它的更多详细信息,
这个问题在这里已经有一个答案:>
How to execute a shell script from C in Linux?6
有没有办法运行命令行实用程序,例如gzip,进入C应用程序? 解决方法
使用
system() :
#include <stdlib.h> int status = system("gzip foo"); 有关如何使用它的更多详细信息,请参阅手册页(man 3系统). 顺便问一下,这个问题已经有了答案:How do I execute external program within C code in linux with arguments? (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |