#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>

int main(){
  int x = fork();
  if (x < 0){
      perror("Errore nella fork:");
      exit(1);
  } else {
    if (x != 0){
      printf("Processo padre\n");
    } else {
      char* argv[] = {"/bin/ls", "/usr", 0};
      execv("/bin/ls",argv );
      perror("Errore nella exec:");
    }
  }
  return 0;
}

    
        
  
