All pastes #109643 Raw Edit

Stuff

public text v1 · immutable
·published 2006-08-01 07:09 UTC
rendered paste body
#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