exec.c 216 B

12345678910
  1. #include <unistd.h>
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. int main(void) {
  5. char* args[] = {"sh", "-c", "echo 'exec works :D'", NULL};
  6. execv("/bin/sh", args);
  7. perror("execv");
  8. return EXIT_SUCCESS;
  9. }