qfedu-linux-advanced-level/day3/d8.c

15 lines
301 B
C

#include <stdio.h>
#include <unistd.h>
int main()
{
// 环境变量动态设置,用于 d7 的读取
char *env[] = {"JAVA_HOME=/opt/java", "PYTHON_HOME=/opt/python", NULL};
int ret = execle("./d7", "d7", NULL, env);
if (ret == -1)
{
perror("./d7");
}
return 0;
}