All pastes #125952 Raw Edit

got_nothing

public c v1 · immutable
·published 2006-08-11 01:40 UTC
rendered paste body
#include <stdio.h>#include <unistd.h>#include <sys/types.h>#include <string.h>int main(){		char *newArgv[100];		char command[100];		char *temp;						while(1)		{			fgets(command,100,stdin);						newArgv[0] = strdup(command);						if(!strcmp(newArgv[0],"exit"))			{			   break;			}			pid_t child;						if(child = fork())			{				}			else			{				execve("/bin/ls",newArgv,NULL);			}		} return 0;}