Stuff
public text v1 · immutable#include <stdio.h>
int main()
{
//char *cmd[] = {"ls", NULL};
//char *env[] = { NULL };
int counter;
char response;
for(counter=0; counter<=4; counter++)
{
//execve("/bin/ls",cmd,env);
printf("continue? y/n \n");
scanf("%c", &response);
if(response == 'n')
{
break;
}
}
}
-----------------------------------------------------
runtime output:
wizo@alphak ~/Work/2nd Year/OS/lab2 $ ./shell_fork
continue? y/n
y
continue? y/n
continue? y/n
y
continue? y/n
continue? y/n
y