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

12 lines
220 B
C

#include <stdio.h>
#include <unistd.h>
int main()
{
char *const argv[] = {"ls", "-l", NULL};
char *const envp[] = {"PATH=/usr/local/bin", "TERM=vt100", NULL};
execve("/bin/ls", argv, envp);
return 0;
}