怎么在c语言程序里调用shell脚本文件

发布网友

我来回答

3个回答

热心网友

int iRetCode;
char sStr[100];
sprintf(sStr,"home/test/upload/unload.sh");
iRetCode=system(sStr);
if(iRetCode<0)
{
  printf("shell error!");
}

热心网友

好像是execute
然后里面直接可以用bash指令

热心网友

system(“这里是你要执行的脚本文件的绝对位置或者相对位置”);

声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com